Table of Contents

Class TaskManager

Namespace
Dynamicweb.Diagnostics.Tasks
Assembly
Dynamicweb.Core.dll

The Class TaskManager provides common operations on the Task objects

public static class TaskManager
Inheritance
TaskManager
Inherited Members

Properties

BaseFolder

Gets or sets the base folder in which diagnostics are stored.

public static string BaseFolder { get; set; }

Property Value

string

The base folder.

Context

Gets or sets the context that provides an independant set of parameters for tasks.

public static Context? Context { get; set; }

Property Value

Context

The context.

Methods

GetActiveTaskNames()

Gets a list of names of active tasks.

public static IEnumerable<string> GetActiveTaskNames()

Returns

IEnumerable<string>

GetTaskInfo(string)

Gets the task information for a task with the given name. If a task with the given name does not exist, null is returned.

public static TaskInfo? GetTaskInfo(string name)

Parameters

name string

The name.

Returns

TaskInfo?

TaskInfo for the task if it exists; otherwise null.

IsTaskActive(string)

Determines whether a task with the given name exists and is running.

public static bool IsTaskActive(string name)

Parameters

name string

The name.

Returns

bool

StartTask(string, Action)

Starts the given task and register the task with the given name.

public static TaskInfo StartTask(string name, Action task)

Parameters

name string

The name.

task Action

The task.

Returns

TaskInfo

StartTask(string, Action<Tracker>)

Starts the given task and register the task with the given name. A Tracker is created and passed through. The task can use the provided Tracker internally.

public static TaskInfo StartTask(string name, Action<Tracker> task)

Parameters

name string

The name.

task Action<Tracker>

The task.

Returns

TaskInfo

StartTask(string, Action<Tracker>, Tracker)

Starts the given task and register the task with the given name using the provided Tracker. The task can use the provided Tracker internally. If the given Tracker is null, a Tracker is created automatically.

public static TaskInfo StartTask(string name, Action<Tracker> task, Tracker tracker)

Parameters

name string

The name.

task Action<Tracker>

The task.

tracker Tracker

The tracker.

Returns

TaskInfo

StartTask<T>(string, Action<Tracker, T>, Tracker, T)

Starts the given task and register the task with the given name. The task can use the provided Tracker internally. If the given Tracker is null, a Tracker is created automatically. An provided object of type T is passed to the task.

public static TaskInfo StartTask<T>(string name, Action<Tracker, T> task, Tracker tracker, T obj)

Parameters

name string

The name.

task Action<Tracker, T>

The task.

tracker Tracker

The tracker.

obj T

The object.

Returns

TaskInfo

Type Parameters

T

The type of the object to pass to the task.

StartTask<T>(string, Action<Tracker, T>, T)

Starts the given task and register the task with the given name. A Tracker is created and passed through. The task can use the provided Tracker internally. An provided object of type T is passed to the task.

public static TaskInfo StartTask<T>(string name, Action<Tracker, T> task, T obj)

Parameters

name string

The name.

task Action<Tracker, T>

The task.

obj T

The object.

Returns

TaskInfo

Type Parameters

T

The type of the object to pass to the task.

To top