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
scheduler
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskSchedulerServiceThe instance of the task scheduler service.
context
Type: Microsoft.VisualStudio.Shell.VsTaskRunContextThe context to use for scheduling the rest of the asynchronous method.
taskCompletionSource
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskCompletionSourceIf a task completion source is passed in, the task created is added as a dependency.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.