CancellationToken Constructor (Boolean)

 

Initializes the CancellationToken.

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

public CancellationToken(
	bool canceled
)

Parameters

canceled
Type: System.Boolean

The canceled state for the token.

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: