CancellationToken.ThrowIfCancellationRequested Metoda

Definicja

OperationCanceledException Zgłasza wyjątek , jeśli ten token zażądał anulowania.

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

Wyjątki

Token zażądał anulowania.

Uwagi

Ta metoda zapewnia funkcjonalność równoważną:

C#

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

Dotyczy

Zobacz też