Delen via


VsTaskLibraryHelper.RunAsyncAsVsTask<T> Method

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function RunAsyncAsVsTask(Of T) ( _
    joinableTaskFactory As JoinableTaskFactory, _
    priority As VsTaskRunContext, _
    asyncMethod As Func(Of CancellationToken, Task(Of T)) _
) As IVsTask
public static IVsTask RunAsyncAsVsTask<T>(
    this JoinableTaskFactory joinableTaskFactory,
    VsTaskRunContext priority,
    Func<CancellationToken, Task<T>> asyncMethod
)
[ExtensionAttribute]
public:
generic<typename T>
static IVsTask^ RunAsyncAsVsTask(
    JoinableTaskFactory^ joinableTaskFactory, 
    VsTaskRunContext priority, 
    Func<CancellationToken, Task<T>^>^ asyncMethod
)
static member RunAsyncAsVsTask : 
        joinableTaskFactory:JoinableTaskFactory * 
        priority:VsTaskRunContext * 
        asyncMethod:Func<CancellationToken, Task<'T>> -> IVsTask
JScript does not support generic types or methods.

Type Parameters

  • T

Parameters

  • asyncMethod
    Type: Func<CancellationToken, Task<T>>

Return Value

Type: Microsoft.VisualStudio.Shell.Interop.IVsTask

Usage Note

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