CancellationToken.ThrowIfCancellationRequested CancellationToken.ThrowIfCancellationRequested CancellationToken.ThrowIfCancellationRequested CancellationToken.ThrowIfCancellationRequested Method

定義

このトークンに対して取り消しが要求された場合、OperationCanceledException をスローします。Throws a OperationCanceledException if this token has had cancellation requested.

public:
 void ThrowIfCancellationRequested();
public void ThrowIfCancellationRequested ();
member this.ThrowIfCancellationRequested : unit -> unit
Public Sub ThrowIfCancellationRequested ()

例外

このトークンに対して取り消しが要求されました。The token has had cancellation requested.

関連付けられている CancellationTokenSource は破棄されています。The associated CancellationTokenSource has been disposed.

注釈

このメソッドは、次に相当する機能を提供します。This method provides functionality equivalent to:

C#C#

if (token.IsCancellationRequested)   
    throw new OperationCanceledException(token);  
If token.IsCancellationRequested Then  
    Throw New OperationCanceledException(token)  
End If  

適用対象

こちらもご覧ください