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.

注釈

このメソッドに相当する機能を提供します。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  

適用対象

こちらもご覧ください