CancellationToken.ThrowIfCancellationRequested 메서드

정의

이 토큰의 취소가 요청된 경우 OperationCanceledException이 발생합니다.

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

예외

이 토큰의 취소가 요청되었습니다.

설명

이 메서드는 다음과 같은 기능을 제공합니다.

C#

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

적용 대상

추가 정보