OperationCanceledException.CancellationToken 属性

定义

获取与已取消的操作关联的令牌。Gets a token associated with the operation that was canceled.

public:
 property System::Threading::CancellationToken CancellationToken { System::Threading::CancellationToken get(); };
public System.Threading.CancellationToken CancellationToken { get; }
member this.CancellationToken : System.Threading.CancellationToken
Public ReadOnly Property CancellationToken As CancellationToken

属性值

与已取消的操作关联的令牌,或默认令牌。A token associated with the operation that was canceled, or a default token.

注解

如果标记与已取消的操作关联, 则该CancellationToken.IsCancellationRequested标记的属性返回。 trueIf the token is associated with a canceled operation, the CancellationToken.IsCancellationRequested property of the token returns true.

适用于