Class TaskRegistry
Represents an object useful for storing in-progress Task instances.
public sealed class TaskRegistry
- Inheritance
-
TaskRegistry
- Inherited Members
- Extension Methods
Constructors
TaskRegistry()
Creates a new empty TaskRegistry instance.
public TaskRegistry()
Properties
Count
Returns the current amount of stored in-progress Task instances.
public int Count { get; }
Property Value
Tasks
Returns all currently stored in-progress Task instances.
public Task[] Tasks { get; }
Property Value
- Task[]
Methods
Add(Task)
Registers provided task in this registry and stores it until it gets completed.
Does nothing when task is already completed.
public void Add(Task task)
Parameters
Remarks
Task continuation that is responsible for removing provided task from this registry once it gets completed
is created with the ExecuteSynchronously option.
Exceptions
- ArgumentException
When TaskStatus of
taskis equal to Created or whentaskhas already been registered.
Contains(Task)
Checks if the provided task is currently stored by this registry.
[Pure]
public bool Contains(Task task)
Parameters
taskTaskTask to check for.
Returns
- bool
true when
taskis currently stored by this registry, otherwise false.