Method | Description | |
---|---|---|
Register ( System.Action callback ) : CancellationTokenRegistration |
Registers a delegate that will be called when cancellation has been requested. The callback is called from a background thread. Wrap via synchronization context to update UI elements. Handling this blocks the task, therefore observers should handle the event quickly. |
|
ThrowIfCancellationRequested ( ) : void |
Throws an OperationCanceledException if cancellation has been requested.
|
|
ToString ( ) : string |
Method | Description | |
---|---|---|
CancellationToken ( CancellationTokenSource source ) : System |
Creates a new token controlled by a specific CancellationTokenSource.
|
public Register ( System.Action callback ) : CancellationTokenRegistration | ||
callback | System.Action | The delegate to be executed when cancellation has been requested. |
return | CancellationTokenRegistration |
public ThrowIfCancellationRequested ( ) : void | ||
return | void |