VsTaskLibraryHelper.GetAwaiter Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetAwaiter(VsTaskRunContext) |
Allows awaiting on a VsTaskRunContext in order to execute code at a particular priority on or off the UI thread. |
GetAwaiter(VsTaskAwaiter) |
Extension method to add await support for VsTaskAwaiter instance which can be returned from ResumeWith call. We simply return the same awaiter instance. |
GetAwaiter(IVsTask) |
Extension method for IVsTask to support await syntax in managed code. |
GetAwaiter(VsTaskRunContext)
Allows awaiting on a VsTaskRunContext in order to execute code at a particular priority on or off the UI thread.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::VisualStudio::Threading::AwaitExtensions::TaskSchedulerAwaiter GetAwaiter(Microsoft::VisualStudio::Shell::VsTaskRunContext context);
public static Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter GetAwaiter (this Microsoft.VisualStudio.Shell.VsTaskRunContext context);
static member GetAwaiter : Microsoft.VisualStudio.Shell.VsTaskRunContext -> Microsoft.VisualStudio.Threading.AwaitExtensions.TaskSchedulerAwaiter
<Extension()>
Public Function GetAwaiter (context As VsTaskRunContext) As AwaitExtensions.TaskSchedulerAwaiter
Parameters
- context
- VsTaskRunContext
The context to run the next segment from the calling async method with.
Returns
An awaiter that will cause the caller to switch to a particular TaskScheduler.
Applies to
GetAwaiter(VsTaskAwaiter)
Extension method to add await support for VsTaskAwaiter instance which can be returned from ResumeWith call.
We simply return the same awaiter instance.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Internal::VisualStudio::Shell::VsTaskAwaiter ^ GetAwaiter(Microsoft::Internal::VisualStudio::Shell::VsTaskAwaiter ^ awaiter);
public static Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter GetAwaiter (this Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter awaiter);
static member GetAwaiter : Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter -> Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter
<Extension()>
Public Function GetAwaiter (awaiter As VsTaskAwaiter) As VsTaskAwaiter
Parameters
- awaiter
- Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter
[in] Awaiter that contains the task that will be used to schedule continuations.
Returns
Returns the same instance of awaiter that this method was called on.
Remarks
This method returns the same awaiter as the one provided in the awaiter
parameter.
Applies to
GetAwaiter(IVsTask)
Extension method for IVsTask to support await syntax in managed code.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Internal::VisualStudio::Shell::VsTaskAwaiter ^ GetAwaiter(Microsoft::VisualStudio::Shell::Interop::IVsTask ^ task);
public static Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter GetAwaiter (this Microsoft.VisualStudio.Shell.Interop.IVsTask task);
static member GetAwaiter : Microsoft.VisualStudio.Shell.Interop.IVsTask -> Microsoft.Internal.VisualStudio.Shell.VsTaskAwaiter
<Extension()>
Public Function GetAwaiter (task As IVsTask) As VsTaskAwaiter
Parameters
- task
- IVsTask
IVsTask instance to be used for scheduling continuations.
Returns
an awaitable object for IVsTask instance.