Compartir a través de


VsTaskLibraryHelper Class

Supplies helper methods for using the Visual Studio task library in managed code.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Shell.VsTaskLibraryHelper

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

Syntax

'Declaración
<ExtensionAttribute> _
Public NotInheritable Class VsTaskLibraryHelper
public static class VsTaskLibraryHelper

The VsTaskLibraryHelper type exposes the following members.

Methods

  Name Description
Public methodStatic member CompleteAfterTask<T>
Public methodStatic member ContinueWhenAllCompleted(IVsTaskSchedulerService, VsTaskRunContext, array<IVsTask[], IVsTaskBody) Creates a Visual Studio task that is run after all the provided tasks have either finished running or have been cancelled. Overrides ContinueWhenAllCompleted.
Public methodStatic member ContinueWhenAllCompleted(IVsTaskSchedulerService, VsTaskRunContext, array<IVsTask[], VsTaskContinuationOptions, IVsTaskBody, Object) Creates a task (using the specified options) that is run after all the given tasks are completed. Overrides ContinueWhenAllCompletedEx.
Public methodStatic member ContinueWith(IVsTask, VsTaskRunContext, IVsTaskBody) Appends the provided action to this task to be run after the task is run to completion. The action is invoked on the context provided. Overrides ContinueWith.
Public methodStatic member ContinueWith(IVsTask, VsTaskRunContext, VsTaskContinuationOptions, IVsTaskBody, Object) Appends the provided action (using the specified options) to this task to be run after the task is run to completion. The action is invoked on the context provided. Overrides ContinueWithEx.
Public methodStatic member CreateAndStartTask Creates a Visual Studio task that is executed with the specified context.
Public methodStatic member CreateAndStartTaskEx Creates a Visual Studio task that is executed with the specified context.
Public methodStatic member CreateTask(IVsTaskSchedulerService, VsTaskRunContext, IVsTaskBody) Creates a task that is run on the given context.
Public methodStatic member CreateTask(IVsTaskSchedulerService, VsTaskRunContext, VsTaskCreationOptions, IVsTaskBody, Object) Creates a task with the specified options that is run on the given context.
Public methodStatic member CreateTaskBody(Action) Creates a task body that can be consumed by the task scheduler service.
Public methodStatic member CreateTaskBody(Object})
Public methodStatic member CreateTaskBody(VsTaskBodyCallback) Creates a task body that can be consumed by the task scheduler service.
Public methodStatic member CreateTaskBody<T>(Action<T>) Creates a task body that can be consumed by the task scheduler service.
Public methodStatic member CreateTaskBody<T>(Object})
Public methodStatic member CreateTaskCompletionSource Creates a task completion source instance with the specified options.
Public methodStatic member Delay(IVsTaskSchedulerService, Double) Retrieves a task that delays execution of the subsequent task by a given period of time.
Public methodStatic member Delay(IVsTaskSchedulerService, TimeSpan) Returns a task that delays execution of the subsequent task by a given period of time.
Public methodStatic member GetAwaiter(IVsTask) Gets the task to be used for scheduling continuations.
Public methodStatic member GetAwaiter(VsTaskAwaiter) Gets the awaiter instance that contains the task that will be used to schedule continuations. Adds await support for an awaiter instance that can be returned from a call to ResumeWith.
Public methodStatic member InvokeAsync<T> transforms a task parallel library (TPL) task from an asynchronous function into an IVsTask.
Public methodStatic member ResumeWith Extension method for task awatier to support awaits with a specific context.
Public methodStatic member Wait(IVsTask, Int32) Waits for the task to complete (not including any continuations). Override for WaitEx with default options.
Public methodStatic member Wait(IVsTask, Int32, VsTaskWaitOptions) Waits for the task to complete (not including any continuations). Override for WaitEx to use proper enumeration types.
Public methodStatic member Yield Yields the current operation on the thread. The rest of the asynchronous method will be scheduled as a continuation.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Shell Namespace