VsTaskLibraryHelper.InvokeAsync<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Helper function that transforms a TPL task from an async function into an IVsTask.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static Microsoft::VisualStudio::Shell::Interop::IVsTask ^ InvokeAsync(Microsoft::VisualStudio::Shell::Interop::IVsTaskSchedulerService ^ scheduler, Microsoft::VisualStudio::Shell::VsInvokableAsyncFunction<T> ^ asyncFunction);
public static Microsoft.VisualStudio.Shell.Interop.IVsTask InvokeAsync<T> (this Microsoft.VisualStudio.Shell.Interop.IVsTaskSchedulerService scheduler, Microsoft.VisualStudio.Shell.VsInvokableAsyncFunction<T> asyncFunction);
static member InvokeAsync : Microsoft.VisualStudio.Shell.Interop.IVsTaskSchedulerService * Microsoft.VisualStudio.Shell.VsInvokableAsyncFunction<'T> -> Microsoft.VisualStudio.Shell.Interop.IVsTask
<Extension()>
Public Function InvokeAsync(Of T) (scheduler As IVsTaskSchedulerService, asyncFunction As VsInvokableAsyncFunction(Of T)) As IVsTask
Type Parameters
- T
The return type of the task.
Parameters
- scheduler
- IVsTaskSchedulerService
IVsTaskScheduler used to create the IVsTaskCompletionSource.
- asyncFunction
- VsInvokableAsyncFunction<T>
Asynchronous function that takes an IVsTaskCompletionSource and returns a TPL task.
Returns
Returns an IVsTask that only completes once the TPL task returned from asyncFunction completes.