DispatcherOperation Class
NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Threading
DispatcherOperation represents a delegate that has been posted to the Dispatcher queue.
public sealed class DispatcherOperation
Properties
Dispatcher
public Dispatcher Dispatcher { get; }
Returns the Dispatcher that this operation was posted to.
Status
public DispatcherOperationStatus Status { get; set; }
The status of this operation.
Result
public object Result { get; }
Returns the result of the operation if it has completed.
Methods
Wait()
public DispatcherOperationStatus Wait()
Waits for this operation to complete.
Returns DispatcherOperationStatus — The status of the operation. To obtain the return value of the invoked delegate, use the the Result property.
Wait(TimeSpan timeout)
public DispatcherOperationStatus Wait(TimeSpan timeout)
Waits for this operation to complete.
| Parameter | Type | Description |
|---|---|---|
timeout | TimeSpan | The maximum amount of time to wait. |
Returns DispatcherOperationStatus — The status of the operation. To obtain the return value of the invoked delegate, use the the Result property.
Abort()
public bool Abort()
Aborts this operation.
Returns bool — False if the operation could not be aborted (because the operation was already in progress)
Events
Aborted
public event EventHandler Aborted
An event that is raised when the operation is aborted.
Completed
public event EventHandler Completed
An event that is raised when the operation completes.