Dela via


VsTaskLibraryHelper.Yield Method (IVsTaskSchedulerService, VsTaskRunContext, IVsTaskCompletionSource)

Yields the current operation on the thread. The rest of the asynchronous method will be scheduled as a continuation.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Yield ( _
    scheduler As IVsTaskSchedulerService, _
    context As VsTaskRunContext, _
    taskCompletionSource As IVsTaskCompletionSource _
) As YieldAwaiter
public static YieldAwaiter Yield(
    this IVsTaskSchedulerService scheduler,
    VsTaskRunContext context,
    IVsTaskCompletionSource taskCompletionSource
)
[ExtensionAttribute]
public:
static YieldAwaiter Yield(
    IVsTaskSchedulerService^ scheduler, 
    VsTaskRunContext context, 
    IVsTaskCompletionSource^ taskCompletionSource
)
static member Yield : 
        scheduler:IVsTaskSchedulerService * 
        context:VsTaskRunContext * 
        taskCompletionSource:IVsTaskCompletionSource -> YieldAwaiter
public static function Yield(
    scheduler : IVsTaskSchedulerService, 
    context : VsTaskRunContext, 
    taskCompletionSource : IVsTaskCompletionSource
) : YieldAwaiter

Parameters

Return Value

Type: YieldAwaiter
An awaiter implementation to use with the await keyword.

Usage Note

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

Yield Overload

Microsoft.VisualStudio.Shell Namespace