Partager via


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

  • cancellationToken
    Type: CancellationToken

    The 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

See Also

Reference

VsTaskLibraryHelper Class

Microsoft.VisualStudio.Shell Namespace