CancellationToken.ThrowIfCancellationRequested Metoda

Definice

Vyvolá požadavek na OperationCanceledException zrušení tohoto tokenu.

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

Výjimky

Token požádal o zrušení.

Poznámky

Tato metoda poskytuje funkce ekvivalentní:

jazyk C#

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

Platí pro

Viz také