共用方式為


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

'宣告
<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

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

See Also

Reference

VsTaskLibraryHelper Class

Microsoft.VisualStudio.Shell Namespace