CancellationToken.ThrowIfCancellationRequested Méthode

Définition

Lève une OperationCanceledException exception si ce jeton a été annulé.

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

Exceptions

Le jeton a été annulé.

Remarques

Cette méthode fournit des fonctionnalités équivalentes à :

C#

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

S’applique à

Voir aussi