Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
461 lines (450 sloc) 27.8 KB
<Type Name="CancellationTokenRegistration" FullName="System.Threading.CancellationTokenRegistration">
<TypeSignature Language="C#" Value="public struct CancellationTokenRegistration : IDisposable, IEquatable&lt;System.Threading.CancellationTokenRegistration&gt;" />
<TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit CancellationTokenRegistration extends System.ValueType implements class System.IDisposable, class System.IEquatable`1&lt;valuetype System.Threading.CancellationTokenRegistration&gt;" />
<TypeSignature Language="DocId" Value="T:System.Threading.CancellationTokenRegistration" />
<TypeSignature Language="VB.NET" Value="Public Structure CancellationTokenRegistration&#xA;Implements IDisposable, IEquatable(Of CancellationTokenRegistration)" />
<TypeSignature Language="C++ CLI" Value="public value class CancellationTokenRegistration : IDisposable, IEquatable&lt;System::Threading::CancellationTokenRegistration&gt;" />
<TypeSignature Language="F#" Value="type CancellationTokenRegistration = struct&#xA; interface IDisposable" />
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ValueType</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IEquatable&lt;System.Threading.CancellationTokenRegistration&gt;</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1">
<AttributeName>System.Runtime.CompilerServices.IsReadOnly</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a callback delegate that has been registered with a <see cref="T:System.Threading.CancellationToken" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## 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](~/docs/standard/threading/cancellation-in-managed-threads.md).
]]></format>
</remarks>
<threadsafe>All public and protected members of <see cref="T:System.Threading.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 <see cref="T:System.Threading.CancellationTokenRegistration" /> have completed.</threadsafe>
<related type="Article" href="~/docs/standard/threading/cancellation-in-managed-threads.md">Cancellation</related>
<related type="Article" href="~/docs/standard/parallel-programming/task-cancellation.md">Task Cancellation</related>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
<Members>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Dispose();" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -&gt; unit&#xA;override this.Dispose : unit -&gt; unit" Usage="cancellationTokenRegistration.Dispose " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IDisposable.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources used by the current instance of the <see cref="T:System.Threading.CancellationTokenRegistration" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Call `Dispose` when you are finished using the <xref:System.Threading.CancellationTokenRegistration>. The `Dispose` method leaves the <xref:System.Threading.CancellationTokenRegistration> in an unusable state. After calling `Dispose`, you must release all references to the <xref:System.Threading.CancellationTokenRegistration> so the garbage collector can reclaim the memory that the <xref:System.Threading.CancellationTokenRegistration> was occupying.
For more information, see [Cleaning Up Unmanaged Resources](~/docs/standard/garbage-collection/unmanaged.md) and [Implementing a Dispose Method](~/docs/standard/garbage-collection/implementing-dispose.md).
> [!NOTE]
> Always call `Dispose` before you release your last reference to the <xref:System.Threading.CancellationTokenRegistration>. Otherwise, the resources it is using will not be freed until the garbage collector calls the <xref:System.Threading.CancellationTokenRegistration> object's `Finalize` method.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
</Member>
<Member MemberName="DisposeAsync">
<MemberSignature Language="C#" Value="public System.Threading.Tasks.ValueTask DisposeAsync ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype System.Threading.Tasks.ValueTask DisposeAsync() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.DisposeAsync" />
<MemberSignature Language="VB.NET" Value="Public Function DisposeAsync () As ValueTask" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::ValueTask DisposeAsync();" />
<MemberSignature Language="F#" Value="abstract member DisposeAsync : unit -&gt; System.Threading.Tasks.ValueTask&#xA;override this.DisposeAsync : unit -&gt; System.Threading.Tasks.ValueTask" Usage="cancellationTokenRegistration.DisposeAsync " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IAsyncDisposable.DisposeAsync</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.ValueTask</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Disposes of the registration and unregisters the target callback from the associated
<see cref="T:System.Threading.CancellationToken" />.</summary>
<returns>A task that represents the asynchronous dispose operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
The returned <xref:System.Threading.Tasks.ValueTask> completes once the associated callback is unregistered without having executed or once it's finished executing, except in the degenerate case where the callback is unregistering itself.
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="Equals">
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Determines whether the current <see cref="T:System.Threading.CancellationTokenRegistration" /> instance is equal to the specified <see cref="T:System.Threading.CancellationTokenRegistration" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.Equals(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Equals (obj As Object) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool Equals(System::Object ^ obj);" />
<MemberSignature Language="F#" Value="override this.Equals : obj -&gt; bool" Usage="cancellationTokenRegistration.Equals obj" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="obj" Type="System.Object" />
</Parameters>
<Docs>
<param name="obj">The other object to which to compare this instance.</param>
<summary>Determines whether the current <see cref="T:System.Threading.CancellationTokenRegistration" /> instance is equal to the specified <see cref="T:System.Threading.CancellationTokenRegistration" />.</summary>
<returns>True, if both this and <paramref name="obj" /> are equal. False, otherwise.
Two <see cref="T:System.Threading.CancellationTokenRegistration" /> instances are equal if they both refer to the output of a single call to the same Register method of a <see cref="T:System.Threading.CancellationToken" />.</returns>
<remarks>To be added.</remarks>
<related type="Article" href="~/docs/standard/threading/cancellation-in-managed-threads.md">Cancellation</related>
<related type="Article" href="~/docs/standard/parallel-programming/task-cancellation.md">Task Cancellation</related>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public bool Equals (System.Threading.CancellationTokenRegistration other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(valuetype System.Threading.CancellationTokenRegistration other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.Equals(System.Threading.CancellationTokenRegistration)" />
<MemberSignature Language="VB.NET" Value="Public Function Equals (other As CancellationTokenRegistration) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool Equals(System::Threading::CancellationTokenRegistration other);" />
<MemberSignature Language="F#" Value="override this.Equals : System.Threading.CancellationTokenRegistration -&gt; bool" Usage="cancellationTokenRegistration.Equals other" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IEquatable`1.Equals(`0)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.Threading.CancellationTokenRegistration" />
</Parameters>
<Docs>
<param name="other">The other <see cref="T:System.Threading.CancellationTokenRegistration" /> to which to compare this instance.</param>
<summary>Determines whether the current <see cref="T:System.Threading.CancellationTokenRegistration" /> instance is equal to the specified <see cref="T:System.Threading.CancellationTokenRegistration" />.</summary>
<returns>True, if both this and <paramref name="other" /> are equal. False, otherwise.
Two <see cref="T:System.Threading.CancellationTokenRegistration" /> instances are equal if they both refer to the output of a single call to the same Register method of a <see cref="T:System.Threading.CancellationToken" />.</returns>
<remarks>To be added.</remarks>
<related type="Article" href="~/docs/standard/threading/cancellation-in-managed-threads.md">Cancellation</related>
<related type="Article" href="~/docs/standard/parallel-programming/task-cancellation.md">Task Cancellation</related>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetHashCode();" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -&gt; int" Usage="cancellationTokenRegistration.GetHashCode " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Serves as a hash function for a <see cref="T:System.Threading.CancellationTokenRegistration" />.</summary>
<returns>A hash code for the current <see cref="T:System.Threading.CancellationTokenRegistration" /> instance.</returns>
<remarks>To be added.</remarks>
<related type="Article" href="~/docs/standard/threading/cancellation-in-managed-threads.md">Cancellation</related>
<related type="Article" href="~/docs/standard/parallel-programming/task-cancellation.md">Task Cancellation</related>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
</Member>
<Member MemberName="op_Equality">
<MemberSignature Language="C#" Value="public static bool operator == (System.Threading.CancellationTokenRegistration left, System.Threading.CancellationTokenRegistration right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Equality(valuetype System.Threading.CancellationTokenRegistration left, valuetype System.Threading.CancellationTokenRegistration right) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.op_Equality(System.Threading.CancellationTokenRegistration,System.Threading.CancellationTokenRegistration)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator == (left As CancellationTokenRegistration, right As CancellationTokenRegistration) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator ==(System::Threading::CancellationTokenRegistration left, System::Threading::CancellationTokenRegistration right);" />
<MemberSignature Language="F#" Value="static member ( = ) : System.Threading.CancellationTokenRegistration * System.Threading.CancellationTokenRegistration -&gt; bool" Usage="left = right" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="left" Type="System.Threading.CancellationTokenRegistration" />
<Parameter Name="right" Type="System.Threading.CancellationTokenRegistration" />
</Parameters>
<Docs>
<param name="left">The first instance.</param>
<param name="right">The second instance.</param>
<summary>Determines whether two <see cref="T:System.Threading.CancellationTokenRegistration" /> instances are equal.</summary>
<returns>True if the instances are equal; otherwise, false.</returns>
<remarks>To be added.</remarks>
<related type="Article" href="~/docs/standard/threading/cancellation-in-managed-threads.md">Cancellation</related>
<related type="Article" href="~/docs/standard/parallel-programming/task-cancellation.md">Task Cancellation</related>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
</Member>
<Member MemberName="op_Inequality">
<MemberSignature Language="C#" Value="public static bool operator != (System.Threading.CancellationTokenRegistration left, System.Threading.CancellationTokenRegistration right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig specialname bool op_Inequality(valuetype System.Threading.CancellationTokenRegistration left, valuetype System.Threading.CancellationTokenRegistration right) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.op_Inequality(System.Threading.CancellationTokenRegistration,System.Threading.CancellationTokenRegistration)" />
<MemberSignature Language="VB.NET" Value="Public Shared Operator != (left As CancellationTokenRegistration, right As CancellationTokenRegistration) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool operator !=(System::Threading::CancellationTokenRegistration left, System::Threading::CancellationTokenRegistration right);" />
<MemberSignature Language="F#" Value="static member op_Inequality : System.Threading.CancellationTokenRegistration * System.Threading.CancellationTokenRegistration -&gt; bool" Usage="System.Threading.CancellationTokenRegistration.op_Inequality (left, right)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="left" Type="System.Threading.CancellationTokenRegistration" />
<Parameter Name="right" Type="System.Threading.CancellationTokenRegistration" />
</Parameters>
<Docs>
<param name="left">The first instance.</param>
<param name="right">The second instance.</param>
<summary>Determines whether two <see cref="T:System.Threading.CancellationTokenRegistration" /> instances are not equal.</summary>
<returns>True if the instances are not equal; otherwise, false.</returns>
<remarks>To be added.</remarks>
<related type="Article" href="~/docs/standard/threading/cancellation-in-managed-threads.md">Cancellation</related>
<related type="Article" href="~/docs/standard/parallel-programming/task-cancellation.md">Task Cancellation</related>
<related type="Article" href="https://msdn.microsoft.com/library/8838dd75-18ed-4b8b-b322-cd4531faac64">How to: Register Callbacks for Cancellation Requests</related>
</Docs>
</Member>
<Member MemberName="Token">
<MemberSignature Language="C#" Value="public System.Threading.CancellationToken Token { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Threading.CancellationToken Token" />
<MemberSignature Language="DocId" Value="P:System.Threading.CancellationTokenRegistration.Token" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Token As CancellationToken" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Threading::CancellationToken Token { System::Threading::CancellationToken get(); };" />
<MemberSignature Language="F#" Value="member this.Token : System.Threading.CancellationToken" Usage="System.Threading.CancellationTokenRegistration.Token" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.CancellationToken</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Threading.CancellationToken" /> with which this registration is associated. If the
registration isn't associated with a token (such as after the registration has been disposed),
this will return a default token.</summary>
<value>The cancellation token with which this registration is associated, or a default token if the
registration isn't associated with a token (such as after the registration has been disposed).</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Unregister">
<MemberSignature Language="C#" Value="public bool Unregister ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Unregister() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.CancellationTokenRegistration.Unregister" />
<MemberSignature Language="VB.NET" Value="Public Function Unregister () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool Unregister();" />
<MemberSignature Language="F#" Value="member this.Unregister : unit -&gt; bool" Usage="cancellationTokenRegistration.Unregister " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime</AssemblyName>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Threading.Tasks</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Disposes of the registration and unregisters the target callback from the associated
<see cref="T:System.Threading.CancellationToken" />.</summary>
<returns><see langword="true" /> if the method succeeds; otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.