Share via


VsTaskLibraryHelper.InvokeAsync<T> Method

transforms a task parallel library (TPL) task from an asynchronous function into an IVsTask.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function InvokeAsync(Of T) ( _
    scheduler As IVsTaskSchedulerService, _
    asyncFunction As VsInvokableAsyncFunction(Of T) _
) As IVsTask
public static IVsTask InvokeAsync<T>(
    this IVsTaskSchedulerService scheduler,
    VsInvokableAsyncFunction<T> asyncFunction
)
[ExtensionAttribute]
public:
generic<typename T>
static IVsTask^ InvokeAsync(
    IVsTaskSchedulerService^ scheduler, 
    VsInvokableAsyncFunction<T>^ asyncFunction
)
static member InvokeAsync : 
        scheduler:IVsTaskSchedulerService * 
        asyncFunction:VsInvokableAsyncFunction<'T> -> IVsTask
JScript does not support generic types or methods.

Type Parameters

  • T
    Return type of the task.

Parameters

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsTask
An IVsTask that only completes once the TPL task that was returned from asyncFunction completes.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IVsTaskSchedulerService. 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