VsTaskLibraryHelper::InvokeAsync<T> Method (IVsTaskSchedulerService^, VsInvokableAsyncFunction<T>^)

 

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

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

public:
generic<typename T>
[ExtensionAttribute]
static IVsTask^ InvokeAsync(
	IVsTaskSchedulerService^ scheduler,
	VsInvokableAsyncFunction<T>^ asyncFunction
)

Parameters

scheduler
Type: Microsoft.VisualStudio.Shell.Interop::IVsTaskSchedulerService^

The task scheduler used to create the IVsTaskCompletionSource.

asyncFunction
Type: Microsoft.VisualStudio.Shell::VsInvokableAsyncFunction<T>^

The asynchronous function that takes an IVsTaskCompletionSource and returns a TPL task.

Return Value

Type: Microsoft.VisualStudio.Shell.Interop::IVsTask^

An IVsTask that completes only when the TPL task that was returned from asyncFunction completes.

Type Parameters

T

The return type of the task.

Return to top
Show: