CancellationToken.ThrowIfCancellationRequested Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
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