Compartir a través de


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

'Declaración
<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
)

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