Partager via


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

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function RunAsync ( _
    joinableTaskFactory As JoinableTaskFactory, _
    priority As VsTaskRunContext, _
    asyncMethod As Func(Of Task) _
) As JoinableTask
public static JoinableTask RunAsync(
    this JoinableTaskFactory joinableTaskFactory,
    VsTaskRunContext priority,
    Func<Task> asyncMethod
)
[ExtensionAttribute]
public:
static JoinableTask^ RunAsync(
    JoinableTaskFactory^ joinableTaskFactory, 
    VsTaskRunContext priority, 
    Func<Task^>^ asyncMethod
)
static member RunAsync : 
        joinableTaskFactory:JoinableTaskFactory * 
        priority:VsTaskRunContext * 
        asyncMethod:Func<Task> -> JoinableTask
public static function RunAsync(
    joinableTaskFactory : JoinableTaskFactory, 
    priority : VsTaskRunContext, 
    asyncMethod : Func<Task>
) : JoinableTask

Parameters

  • asyncMethod
    Type: Func<Task>

Return Value

Type: Microsoft.VisualStudio.Threading.JoinableTask

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