VsTaskLibraryHelper.ApplyCancellationToken Method
Signals a Visual Studio task to cancel operations as soon as possible when the specified token is canceled.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub ApplyCancellationToken ( _
task As IVsTask, _
cancellationToken As CancellationToken _
)
public static void ApplyCancellationToken(
this IVsTask task,
CancellationToken cancellationToken
)
[ExtensionAttribute]
public:
static void ApplyCancellationToken(
IVsTask^ task,
CancellationToken cancellationToken
)
static member ApplyCancellationToken :
task:IVsTask *
cancellationToken:CancellationToken -> unit
public static function ApplyCancellationToken(
task : IVsTask,
cancellationToken : CancellationToken
)
Parameters
task
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskThe task that may be canceled.
cancellationToken
Type: CancellationTokenThe cancellation token.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IVsTask. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.