CancellationTokenRegistration Structure
TOC
Collapse the table of content
Expand the table of content

CancellationTokenRegistration Structure

.NET Framework (current version)
 

Represents a callback delegate that has been registered with a CancellationToken.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

<HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True,
	ExternalThreading := True)>
Public Structure CancellationTokenRegistration
	Implements IEquatable(Of CancellationTokenRegistration), IDisposable

NameDescription
System_CAPS_pubmethodDispose()

Releases all resources used by the current instance of the CancellationTokenRegistration class.

System_CAPS_pubmethodEquals(CancellationTokenRegistration)

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

System_CAPS_pubmethodEquals(Object)

Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration.(Overrides ValueType.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Serves as a hash function for a CancellationTokenRegistration.(Overrides ValueType.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the fully qualified type name of this instance.(Inherited from ValueType.)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(CancellationTokenRegistration, CancellationTokenRegistration)

Determines whether two CancellationTokenRegistration instances are equal.

System_CAPS_puboperatorSystem_CAPS_staticInequality(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.

Universal Windows Platform
Available since 4.5
.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.

Return to top
Show:
© 2016 Microsoft