CancellationTokenRegistration Structure
Represents a callback delegate that has been registered with a CancellationToken.
Assembly: mscorlib (in mscorlib.dll)
| Name | Description | |
|---|---|---|
![]() | Dispose() | Releases all resources used by the current instance of the CancellationTokenRegistration class. |
![]() | Equals(CancellationTokenRegistration) | Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration. |
![]() | Equals(Object^) | Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration.(Overrides ValueType::Equals(Object^).) |
![]() | GetHashCode() | Serves as a hash function for a CancellationTokenRegistration.(Overrides ValueType::GetHashCode().) |
![]() | GetType() | |
![]() | ToString() | Returns the fully qualified type name of this instance.(Inherited from ValueType.) |
| Name | Description | |
|---|---|---|
![]() ![]() | Equality(CancellationTokenRegistration, CancellationTokenRegistration) | Determines whether two CancellationTokenRegistration instances are equal. |
![]() ![]() | Inequality(CancellationTokenRegistration, CancellationTokenRegistration) | Determines whether two CancellationTokenRegistration instances are not equal. |
The callback is called when the token is canceled. To unregister a callback, dispose the corresponding Registration instance. For more information and code examples see Cancellation in Managed Threads.
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
All public and protected members of CancellationTokenRegistration are thread-safe and may be used concurrently from multiple threads, with the exception of Dispose, which must only be used when all other operations on the CancellationTokenRegistration have completed.


