Editar

Compartir a través de


CancellationToken(Boolean) Constructor

Definition

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