NanoByte.Common 2.11.0
NanoByte.Common.Threading.WaitTask Class Reference

Waits for a WaitHandle to become available. More...

Inheritance diagram for NanoByte.Common.Threading.WaitTask:
NanoByte.Common.Tasks.TaskBase NanoByte.Common.Tasks.ITask

Public Member Functions

 WaitTask ([Localizable(true)] string name, WaitHandle waitHandle, int millisecondsTimeout=Timeout.Infinite)
 Creates a new handle-waiting task. More...
 
- Public Member Functions inherited from NanoByte.Common.Tasks.TaskBase
void Run (CancellationToken cancellationToken=default, ICredentialProvider? credentialProvider=null, IProgress< TaskSnapshot >? progress=null)
 Runs the task and blocks until it is complete. More...
 

Protected Member Functions

override void Execute ()
 The actual code to be executed. More...
 

Properties

override string Name [get]
 
override bool UnitsByte [get]
 
- Properties inherited from NanoByte.Common.Tasks.TaskBase
abstract string Name [get]
 
object? Tag [getset]
 
virtual bool CanCancel [get]
 
TaskState State [getprotected set]
 The current State of the task.
 
abstract bool UnitsByte [get]
 true if UnitsProcessed and UnitsTotal are measured in bytes; false if they are measured in generic units.
 
long UnitsProcessed [getset]
 The number of units that have been processed so far.
 
long UnitsTotal [getset]
 The total number of units that are to be processed; -1 for unknown.
 
- Properties inherited from NanoByte.Common.Tasks.ITask
string Name [get]
 A name describing the task in human-readable form.
 
object? Tag [getset]
 An object used to associate the task with a specific process; can be null.
 
bool CanCancel [get]
 Indicates whether this task can be canceled once it has been started.
 

Additional Inherited Members

- Protected Attributes inherited from NanoByte.Common.Tasks.TaskBase
CancellationToken CancellationToken
 Signaled when the user wishes to cancel the task execution.
 
ICredentialProviderCredentialProvider
 Used to retrieve credentials for specific Uris on demand; can be null.
 

Detailed Description

Waits for a WaitHandle to become available.

Constructor & Destructor Documentation

◆ WaitTask()

NanoByte.Common.Threading.WaitTask.WaitTask ( [Localizable(true)] string  name,
WaitHandle  waitHandle,
int  millisecondsTimeout = Timeout.Infinite 
)
inline

Creates a new handle-waiting task.

Parameters
nameA name describing the task in human-readable form.
waitHandle>The WaitHandle to wait for.
millisecondsTimeoutThe number of milliseconds to wait before raising TimeoutException; Timeout.Infinite to wait indefinitely.

Member Function Documentation

◆ Execute()

override void NanoByte.Common.Threading.WaitTask.Execute ( )
inlineprotectedvirtual

The actual code to be executed.

Implements NanoByte.Common.Tasks.TaskBase.


The documentation for this class was generated from the following file: