Compartir a través de


VsTaskLibraryHelper.RunAsync<T> Method (JoinableTaskFactory, VsTaskRunContext, Func<Task<T>>)

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

Syntax

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

Type Parameters

  • T

Parameters

  • asyncMethod
    Type: Func<Task<T>>

Return Value

Type: Microsoft.VisualStudio.Threading.JoinableTask<T>

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

RunAsync Overload

Microsoft.VisualStudio.Shell Namespace