VsTaskLibraryHelper.Yield Method
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.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'Declaración
<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
)
Parameters
- scheduler
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskSchedulerService
The instance of the task scheduler service.
- context
Type: Microsoft.VisualStudio.Shell.VsTaskRunContext
Context to use for scheduling the rest of the asynchronous method.
- taskCompletionSource
Type: Microsoft.VisualStudio.Shell.Interop.IVsTaskCompletionSource
If a task completion source is passed in, the task created is added as a dependency.
Return Value
Type: Microsoft.Internal.VisualStudio.Shell.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.