CancellationToken(Boolean) 建構函式

定義

初始化 CancellationTokenInitializes the CancellationToken.

public:
 CancellationToken(bool canceled);
public CancellationToken (bool canceled);
new System.Threading.CancellationToken : bool -> System.Threading.CancellationToken
Public Sub New (canceled As Boolean)

參數

canceled
Boolean

語彙基元的已取消狀態。The canceled state for the token.

備註

使用此函式建立的權杖會保留在 canceled 參數所指定的已取消狀態。Tokens created with this constructor will remain in the canceled state specified by the canceled parameter. 如果 false``canceledCanBeCanceledIsCancellationRequested 將會 falseIf canceled is false, both CanBeCanceled and IsCancellationRequested will be false.

如果 true``canceledCanBeCanceledIsCancellationRequested 將會 trueIf canceled is true, both CanBeCanceled and IsCancellationRequested will be true.

適用於

另請參閱