<PackageReference Include="Microsoft.Bcl" Version="1.1.8" />

System.Threading.CancellationToken

public struct CancellationToken
Propogates notification that operations should be canceled.
public static CancellationToken None { get; }

Returns an empty CancellationToken value.

public bool CanBeCanceled { get; }

Gets whether this token is capable of being in the canceled state.

public bool IsCancellationRequested { get; }

Gets whether cancellation has been requested for this token.

public WaitHandle WaitHandle { get; }

Gets a WaitHandle that is signaled when the token is canceled.

public CancellationToken(bool canceled)

Initializes the CancellationTokenCancellationToken.

public static bool op_Equality(CancellationToken left, CancellationToken right)

Determines whether two CancellationTokenCancellationToken instances are equal.

public static bool op_Inequality(CancellationToken left, CancellationToken right)

Determines whether two CancellationTokenCancellationToken instances are not equal.

public bool Equals(CancellationToken other)

Determines whether the current CancellationTokenCancellationToken instance is equal to the specified token.

Registers a delegate that will be called when this CancellationTokenCancellationToken is canceled.

public CancellationTokenRegistration Register(Action callback, bool useSynchronizationContext)

Registers a delegate that will be called when this CancellationTokenCancellationToken is canceled.

public CancellationTokenRegistration Register(Action<object> callback, object state)

Registers a delegate that will be called when this CancellationTokenCancellationToken is canceled.

public CancellationTokenRegistration Register(Action<object> callback, object state, bool useSynchronizationContext)

Registers a delegate that will be called when this CancellationTokenCancellationToken is canceled.

Throws a OperationCanceledExceptionOperationCanceledException if this token has had cancellation requested.