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

System.Threading.CancellationTokenSource

public sealed class CancellationTokenSource : IDisposable
Signals to a CancellationToken that it should be canceled.
public bool IsCancellationRequested { get; }

Gets whether cancellation has been requested for this CancellationTokenSourceCancellationTokenSource.

public CancellationToken Token { get; }

Gets the CancellationTokenCancellationToken associated with this CancellationTokenSource.

Initializes the CancellationTokenSource.

Creates a CancellationTokenSourceCancellationTokenSource that will be in the canceled state when any of the source tokens are in the canceled state.

Creates a CancellationTokenSourceCancellationTokenSource that will be in the canceled state when any of the source tokens are in the canceled state.

public void Cancel()

Communicates a request for cancellation.

public void Cancel(bool throwOnFirstException)

Communicates a request for cancellation.

public void Dispose()

Releases the resources used by this CancellationTokenSource.