CancellationToken.ThrowIfCancellationRequested Metode

Definisi

OperationCanceledException Melempar jika token ini telah meminta pembatalan.

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

Pengecualian

Token telah meminta pembatalan.

Keterangan

Metode ini menyediakan fungsionalitas yang setara dengan:

C#

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

Berlaku untuk

Lihat juga