CancellationToken.ThrowIfCancellationRequested Metódus

Definíció

A rendszer a OperationCanceledException jogkivonat lemondását kéri.

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

Kivételek

A jogkivonat lemondását kérték.

Megjegyzések

Ez a módszer a következő funkciókkal egyenértékű funkciókat biztosít:

C#

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

A következőre érvényes:

Lásd még