Class WaitTask
Waits for a System.Threading.WaitHandle to become available or the System.Threading.CancellationToken to be triggered.
public sealed class WaitTask : TaskBase, ITask
- Inheritance
-
objectMarshalByRefObjectWaitTask
- Implements
- Inherited Members
- Extension Methods
Constructors
WaitTask(string, WaitHandle?, int)
Waits for a System.Threading.WaitHandle to become available or the System.Threading.CancellationToken to be triggered.
public WaitTask(string name, WaitHandle? waitHandle = null, int millisecondsTimeout = -1)
Parameters
name
stringA name describing the task in human-readable form.
waitHandle
WaitHandleThe System.Threading.WaitHandle to wait for;
null
to wait for System.Threading.CancellationToken.millisecondsTimeout
intThe number of milliseconds to wait before raising System.TimeoutException; System.Threading.Timeout.Infinite to wait indefinitely.
Properties
Name
A name describing the task in human-readable form.
public override string Name { get; }
Property Value
- string
PreventIdle
Indicates whether this task should prevent the system from entering idle mode.
protected override bool PreventIdle { get; }
Property Value
- bool
UnitsByte
true
if UnitsProcessed and UnitsTotal are measured in bytes;
false
if they are measured in generic units.
protected override bool UnitsByte { get; }
Property Value
- bool
Methods
Execute()
The actual code to be executed.
protected override void Execute()
Remarks
State is automatically set to Started before calling this method, to Complete after a successful exit and to an appropriate error state in case on an exception. You can set additional TaskStates during execution.