mscorlib 4.0.0.0 System.ValueType System.Diagnostics.DebuggerDisplay("IsCancellationRequested = {IsCancellationRequested}")

For more information and code examples see Cancellation.

Propagates notification that operations should be canceled.

- Constructor
  4.0.0.0

  Tokens created with this constructor will remain in the canceled state specified by the parameter. If is false, both and will be false.

  If is true, both and will be true.

  Initializes the .

  The canceled state for the token.
- Property
  4.0.0.0
  System.Boolean To be added.

  If CanBeCanceled returns false, it is guaranteed that the token will never transition into a canceled state, meaning that will never return true.

  Gets whether this token is capable of being in the canceled state.

- Method
  4.0.0.0
  System.Boolean `` To be added.

  Determines whether the current instance is equal to the specified .

  True if is a and if the two instances are equal; otherwise, false. Two tokens are equal if they are associated with the same or if they were both constructed from public CancellationToken constructors and their values are equal.

  The other object to which to compare this instance.
- Method
  4.0.0.0
  System.Boolean `` To be added.

  Determines whether the current instance is equal to the specified token.

  True if the instances are equal; otherwise, false. Two tokens are equal if they are associated with the same or if they were both constructed from public CancellationToken constructors and their values are equal.

  The other to which to compare this instance.
- Method
  4.0.0.0
  System.Int32 To be added.

  Serves as a hash function for a .

  A hash code for the current instance.

- Property
  4.0.0.0
  System.Boolean To be added.

  This property indicates whether cancellation has been requested for this token, either through the token initially being constructed in a canceled state, or through calling on the token's associated .

  If this property is true, it only guarantees that cancellation has been requested.

  It does not guarantee that every registered handler has finished executing, nor that cancellation requests have finished propagating to all registered handlers. Additional synchronization may be required, particularly in situations where related objects are being canceled concurrently.

  Gets whether cancellation has been requested for this token.

- Property
  4.0.0.0
  System.Threading.CancellationToken To be added.

  The value returned by this property will be non-cancelable by default.

  Returns an empty CancellationToken value.

- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Determines whether two instances are equal.

  True if the instances are equal; otherwise, false.

  The first instance. The second instance.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Determines whether two instances are not equal.

  True if the instances are not equal; otherwise, false.

  The first instance. The second instance.
- Method
  4.0.0.0
  System.Threading.CancellationTokenRegistration ``

  If this token is already in the canceled state, the delegate will be run immediately and synchronously. Any exception the delegate generates will be propagated out of this method call.

  The current , if one exists, will be captured along with the delegate and will be used when executing it.

  Registers a delegate that will be called when this is canceled.

  The instance that can be used to deregister the callback.

  The delegate to be executed when the is canceled.
- Method
  4.0.0.0
  System.Threading.CancellationTokenRegistration `` ``

  If this token is already in the canceled state, the delegate will be run immediately and synchronously. Any exception the delegate generates will be propogated out of this method call.

  The current , if one exists, will be captured along with the delegate and will be used when executing it.

  Registers a delegate that will be called when this is canceled.

  The instance that can be used to deregister the callback.

  The delegate to be executed when the is canceled. A Boolean value that indicates whether to capture the current and use it when invoking the .
- Method
  4.0.0.0
  System.Threading.CancellationTokenRegistration `` ``

  If this token is already in the canceled state, the delegate will be run immediately and synchronously. Any exception the delegate generates will be propogated out of this method call.

  The current , if one exists, will be captured along with the delegate and will be used when executing it.

  Registers a delegate that will be called when this is canceled.

  The instance that can be used to deregister the callback.

  The delegate to be executed when the is canceled. The state to pass to the when the delegate is invoked. This may be null.
- Method
  4.0.0.0
  System.Threading.CancellationTokenRegistration `` `` ``

  If this token is already in the canceled state, the delegate will be run immediately and synchronously. Any exception the delegate generates will be propogated out of this method call.

  The current , if one exists, will be captured along with the delegate and will be used when executing it.

  Registers a delegate that will be called when this is canceled.

  The instance that can be used to deregister the callback.

  The delegate to be executed when the is canceled. The state to pass to the when the delegate is invoked. This may be null. A Boolean value that indicates whether to capture the current and use it when invoking the .
- Method
  4.0.0.0
  System.Void

  This method provides functionality equivalent to:

  C#

  `if (token.IsCancellationRequested) throw new OperationCanceledException(token);` `If token.IsCancellationRequested Then Throw New OperationCanceledException(token) End If`

  Throws a if this token has had cancellation requested.

- Property
  4.0.0.0
  System.Threading.WaitHandle To be added.

  Accessing this property causes a to be instantiated. It is preferable to only use this property when necessary, and to then dispose the associated instance at the earliest opportunity (disposing the source will dispose of this allocated handle). The handle should not be closed or disposed directly.

  Gets a that is signaled when the token is canceled.