TaskExtensions.ThrowIfCancellationRequested Method
Throws an exception if cancellation was requested.
Namespace: Microsoft.WindowsAzure.MediaServices.Client
Assembly: Microsoft.WindowsAzure.MediaServices.Client (in Microsoft.WindowsAzure.MediaServices.Client.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub ThrowIfCancellationRequested ( _
cancellationToken As CancellationToken, _
cancelledCallback As Action _
)
'Usage
Dim cancellationToken As CancellationToken
Dim cancelledCallback As Action
cancellationToken.ThrowIfCancellationRequested(cancelledCallback)
public static void ThrowIfCancellationRequested(
this CancellationToken cancellationToken,
Action cancelledCallback
)
[ExtensionAttribute]
public:
static void ThrowIfCancellationRequested(
CancellationToken cancellationToken,
Action^ cancelledCallback
)
static member ThrowIfCancellationRequested :
cancellationToken:CancellationToken *
cancelledCallback:Action -> unit
public static function ThrowIfCancellationRequested(
cancellationToken : CancellationToken,
cancelledCallback : Action
)
Parameters
- cancellationToken
Type: System.Threading.CancellationToken
The cancellation token.
- cancelledCallback
Type: System.Action
The cancelled callback.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type CancellationToken. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=azure.100) or https://msdn.microsoft.com/en-us/library/bb383977(v=azure.100).