CancellationToken.ThrowIfCancellationRequested Methode

Definitie

Genereert een OperationCanceledException als dit token annulering heeft aangevraagd.

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

Uitzonderingen

Het token heeft annulering aangevraagd.

Opmerkingen

Deze methode biedt functionaliteit die gelijk is aan:

C#

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

Van toepassing op

Zie ook