CancellationToken Constructor

Task Parallel System.Threading

Initializes the CancellationToken.

Namespace:  System.Threading
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Sub New ( _
	canceled As Boolean _
)
C#
public CancellationToken(
	bool canceled
)

Parameters

canceled
Type: System..::.Boolean
The canceled state for the token.

Remarks

Tokens created with this constructor will remain in the canceled state specified by the canceled parameter. If canceled is false, both CanBeCanceled and IsCancellationRequested will be false. If canceled is true, both CanBeCanceled and IsCancellationRequested will be true.

See Also