CancellationToken.None 属性

定义

返回一个空 CancellationToken 值。Returns an empty CancellationToken value.

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

属性值

一个空取消标记。An empty cancellation token.

注解

此属性返回的取消标记无法取消;也就是说,其 CanBeCanceled 属性 @no__t 为-1。The cancellation token returned by this property cannot be canceled; that is, its CanBeCanceled property is false.

你还可以使用C# default (CancellationToken)语句创建空取消标记。You can also use the C# default(CancellationToken) statement to create an empty cancellation token.

两个空取消标记始终相等。Two empty cancellation tokens are always equal.

适用于

另请参阅