CancellationTokenRegistration 構造体
定義
CancellationToken に登録されているコールバック デリゲートを表します。Represents a callback delegate that has been registered with a CancellationToken.
public value class CancellationTokenRegistration : IDisposable, IEquatable<System::Threading::CancellationTokenRegistration>
public value class CancellationTokenRegistration : IAsyncDisposable, IDisposable, IEquatable<System::Threading::CancellationTokenRegistration>
public struct CancellationTokenRegistration : IDisposable, IEquatable<System.Threading.CancellationTokenRegistration>
public struct CancellationTokenRegistration : IAsyncDisposable, IDisposable, IEquatable<System.Threading.CancellationTokenRegistration>
type CancellationTokenRegistration = struct
interface IDisposable
type CancellationTokenRegistration = struct
interface IAsyncDisposable
interface IDisposable
Public Structure CancellationTokenRegistration
Implements IDisposable, IEquatable(Of CancellationTokenRegistration)
Public Structure CancellationTokenRegistration
Implements IAsyncDisposable, IDisposable, IEquatable(Of CancellationTokenRegistration)
- 継承
- 実装
注釈
このコールバックは、トークンが取り消されたときに呼び出されます。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.
プロパティ
Token |
登録が関連付けられている CancellationToken を取得します。Gets the CancellationToken with which this registration is associated. |
メソッド
Dispose() |
CancellationTokenRegistration クラスの現在のインスタンスによって使用されているすべてのリソースを解放します。Releases all resources used by the current instance of the CancellationTokenRegistration class. |
DisposeAsync() |
登録を破棄して、関連付けられている CancellationToken から対象のコールバックの登録を解除します。Disposes of the registration and unregisters the target callback from the associated CancellationToken. |
Equals(CancellationTokenRegistration) |
現在の CancellationTokenRegistration インスタンスが指定された CancellationTokenRegistration と等しいかどうかを判断します。Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration. |
Equals(Object) |
現在の CancellationTokenRegistration インスタンスが指定された CancellationTokenRegistration と等しいかどうかを判断します。Determines whether the current CancellationTokenRegistration instance is equal to the specified CancellationTokenRegistration. |
GetHashCode() |
CancellationTokenRegistration のハッシュ関数として機能します。Serves as a hash function for a CancellationTokenRegistration. |
Unregister() |
登録を破棄して、関連付けられている CancellationToken から対象のコールバックの登録を解除します。Disposes of the registration and unregisters the target callback from the associated CancellationToken. |
演算子
Equality(CancellationTokenRegistration, CancellationTokenRegistration) |
2 つの CancellationTokenRegistration インスタンスが等しいかどうかを判断します。Determines whether two CancellationTokenRegistration instances are equal. |
Inequality(CancellationTokenRegistration, CancellationTokenRegistration) |
2 つの CancellationTokenRegistration インスタンスが等しくないかどうかを判断します。Determines whether two CancellationTokenRegistration instances are not equal. |
拡張メソッド
ConfigureAwait(IAsyncDisposable, Boolean) |
非同期の破棄可能から返されるタスク上での待機がどのように実行されるかを構成します。Configures how awaits on the tasks returned from an async disposable are performed. |
適用対象
スレッド セーフ
のパブリックメンバーとプロテクトメンバー CancellationTokenRegistration はすべてスレッドセーフであり、複数のスレッドから同時に使用することができます。 Dispose は例外です。これは、の他のすべての操作が完了している場合にのみ使用する必要があり CancellationTokenRegistration ます。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.