CancellationTokenRegistration CancellationTokenRegistration CancellationTokenRegistration CancellationTokenRegistration Struct

Definition

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

public value class CancellationTokenRegistration : IDisposable, IEquatable<System::Threading::CancellationTokenRegistration>
public struct CancellationTokenRegistration : IDisposable, IEquatable<System.Threading.CancellationTokenRegistration>
type CancellationTokenRegistration = struct
    interface IDisposable
Public Structure CancellationTokenRegistration
Implements IDisposable, IEquatable(Of CancellationTokenRegistration)
Inheritance
CancellationTokenRegistrationCancellationTokenRegistrationCancellationTokenRegistrationCancellationTokenRegistration
Implements

Remarks

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.

Properties

Token Token Token Token

Methods

Dispose() Dispose() Dispose() Dispose()

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

Equals(CancellationTokenRegistration) Equals(CancellationTokenRegistration) Equals(CancellationTokenRegistration) Equals(CancellationTokenRegistration)

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as a hash function for a CancellationTokenRegistration.

Operators

Equality(CancellationTokenRegistration, CancellationTokenRegistration) Equality(CancellationTokenRegistration, CancellationTokenRegistration) Equality(CancellationTokenRegistration, CancellationTokenRegistration) Equality(CancellationTokenRegistration, CancellationTokenRegistration)

Determines whether two CancellationTokenRegistration instances are equal.

Inequality(CancellationTokenRegistration, CancellationTokenRegistration) Inequality(CancellationTokenRegistration, CancellationTokenRegistration) Inequality(CancellationTokenRegistration, CancellationTokenRegistration) Inequality(CancellationTokenRegistration, CancellationTokenRegistration)

Determines whether two CancellationTokenRegistration instances are not equal.

Applies to

Thread Safety

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.