CancellationToken.ThrowIfCancellationRequested Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
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