Class InterruptionToken
Propagates a cooperative cancellation request to long-running save, load, and export operations. Created by InterruptionTokenSource; pass the token via InterruptionToken or InterruptionToken.
Operations that accept a token periodically check IsCancellationRequested and throw OperationCanceledException when cancellation is requested.
Inherited Members
Namespace: DRIT.Presentation
Assembly: DRIT.Presentation.dll
Syntax
public sealed class InterruptionToken
Properties
IsCancellationRequested
Gets whether cancellation has been requested for this token.
Declaration
public bool IsCancellationRequested { get; }
Property Value
| Type | Description |
|---|---|
| bool |
None
Returns an empty token that never requests cancellation.
Declaration
public static InterruptionToken None { get; }
Property Value
| Type | Description |
|---|---|
| InterruptionToken |
Methods
ThrowIfCancellationRequested()
Throws an OperationCanceledException if cancellation has been requested. Long-running operations should call this periodically (e.g. once per slide) to allow cooperative cancellation.
Declaration
public void ThrowIfCancellationRequested()