CancellationTokenRegistration.Token 属性

定义

获取与此注册关联的 CancellationTokenGets the CancellationToken with which this registration is associated.

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

属性值

CancellationToken

与此注册关联的取消标记,如果注册不与令牌相关联,则为默认令牌。The cancellation token with which this registration is associated, or a default token if the registration isn't associated with a token.

注解

如果 CancellationTokenRegistration 是通过向已请求取消的注册创建的 CancellationToken ,则注册可能不会与令牌相关联,在这种情况下,此属性可能会返回默认令牌。If the CancellationTokenRegistration was created by registering with a CancellationToken that already had cancellation requested, the registration may not be associated with the token, in which case this property may return a default token.

适用于