CancellationToken(Boolean) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes the CancellationToken.
public:
CancellationToken(bool canceled);
public CancellationToken (bool canceled);
new System.Threading.CancellationToken : bool -> System.Threading.CancellationToken
Public Sub New (canceled As Boolean)
Parameters
- canceled
- 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
.
Applies to
See also
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.