System.Threading.CancellationTokenSource Members

The members of System.Threading.CancellationTokenSource are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Threading.CancellationTokenSource class.

Initializes a new instance of the System.Threading.CancellationTokenSource class that will be canceled after the specified delay in milliseconds.

Initializes a new instance of the System.Threading.CancellationTokenSource class that will be canceled after the specified time span.

Public Properties

[read-only]
IsCancellationRequestedbool.

Gets whether cancellation has been requested for this System.Threading.CancellationTokenSource.

[read-only]
TokenCancellationToken.

Gets the System.Threading.CancellationToken associated with this System.Threading.CancellationTokenSource.

Public Methods

Cancel()

Communicates a request for cancellation.

Cancel(bool)

Communicates a request for cancellation, and specifies whether remaining callbacks and cancelable operations should be processed.

CancelAfter(int)

Schedules a cancel operation on this System.Threading.CancellationTokenSource after the specified number of milliseconds.

CancelAfter(TimeSpan)

Schedules a cancel operation on this System.Threading.CancellationTokenSource after the specified time span.

static
CreateLinkedTokenSource(params CancellationToken[]) : CancellationTokenSource

Creates a System.Threading.CancellationTokenSource that will be in the canceled state when any of the source tokens in the specified array are in the canceled state.

static
CreateLinkedTokenSource(CancellationToken, CancellationToken) : CancellationTokenSource

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

Dispose()

Releases all resources used by the current instance of the System.Threading.CancellationTokenSource class.

Protected Methods

Dispose(bool)

Releases the unmanaged resources used by the System.Threading.CancellationTokenSource class and optionally releases the managed resources.