struct CancellationToken
in global :: System . Threading
Propagates notification that operations should be canceled.
public CancellationToken( bool canceled )
Initializes the .
canceledThe canceled state for the token.
public bool CanBeCanceled { get; }
Gets whether this token is capable of being in the canceled state.
- Returns if this token is capable of being in the canceled state; otherwise, .
public bool Equals( object other )
Determines whether the current instance is equal to the specified .
otherThe other object to compare with this instance.- Returns if is a and if the two instances are equal; otherwise, . See the Remarks section for more information.
public bool Equals( CancellationToken other )
Determines whether the current instance is equal to the specified token.
otherThe other to compare with this instance.- Returns if the instances are equal; otherwise, . See the Remarks section for more information.
public bool IsCancellationRequested { get; }
Gets whether cancellation has been requested for this token.
- Returns if cancellation has been requested for this token; otherwise, .
public static CancellationToken None { get; }
Returns an empty value.
- Returns An empty cancellation token.
public static bool op_Equality( CancellationToken left, CancellationToken right )
Determines whether two instances are equal.
leftThe first instance.rightThe second instance.- Returns if the instances are equal; otherwise, See the Remarks section for more information.
public static bool op_Inequality( CancellationToken left, CancellationToken right )
Determines whether two instances are not equal.
leftThe first instance.rightThe second instance.- Returns if the instances are not equal; otherwise, .
public CancellationTokenRegistration Register( Action callback )
Registers a delegate that will be called when this is canceled.
callbackThe delegate to be executed when the is canceled.- Returns The instance that can be used to unregister the callback.
public CancellationTokenRegistration Register( Action callback, bool useSynchronizationContext )
Registers a delegate that will be called when this is canceled.
callbackThe delegate to be executed when the is canceled.useSynchronizationContextA value that indicates whether to capture the current and use it when invoking the .- Returns The instance that can be used to unregister the callback.
public CancellationTokenRegistration Register( Action<object,CancellationToken> callback, object state )
😔 No documentation found.
public CancellationTokenRegistration Register( Action<object> callback, object state, bool useSynchronizationContext )
😔 No documentation found.
public CancellationTokenRegistration UnsafeRegister( Action<object> callback, object state )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public void ThrowIfCancellationRequested( )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public CancellationTokenRegistration Register( Action<object> callback, object state )
😔 No documentation found.
public CancellationTokenRegistration UnsafeRegister( Action<object,CancellationToken> callback, object state )
😔 No documentation found.