Delen via


VsTaskLibraryHelper Class

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

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.Shell.VsTaskLibraryHelper

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

Syntax

'Declaration
<ExtensionAttribute> _
Public NotInheritable Class VsTaskLibraryHelper
public static class VsTaskLibraryHelper
[ExtensionAttribute]
public ref class VsTaskLibraryHelper abstract sealed
[<AbstractClass>]
[<Sealed>]
type VsTaskLibraryHelper =  class end
public final class VsTaskLibraryHelper

The VsTaskLibraryHelper type exposes the following members.

Properties

  Name Description
Public propertyStatic member ServiceInstance Gets the singleton service instance.

Top

Methods

  Name Description
Public methodStatic member ApplyCancellationToken Signals a Visual Studio task to cancel operations as soon as possible when the specified token is canceled.
Public methodStatic member AsVsTask<T> Wraps a JoinableTask<T> instance in an IVsTask that can be returned to COM clients.
Public methodStatic member CompleteAfterTask<T>
Public methodStatic member ContinueWhenAllCompleted(IVsTaskSchedulerService, VsTaskRunContext, array<IVsTask[], IVsTaskBody) Creates a Visual Studio task that's run after the provided tasks have either finished running or been cancelled. Overrides ContinueWhenAllCompleted.
Public methodStatic member ContinueWhenAllCompleted(IVsTaskSchedulerService, VsTaskRunContext, array<IVsTask[], VsTaskContinuationOptions, IVsTaskBody, Object) Uses the specified options to create a task that's run after the given tasks are completed. Overrides ContinueWhenAllCompletedEx.
Public methodStatic member ContinueWith(IVsTask, VsTaskRunContext, IVsTaskBody) Appends to this task the provided action, to be run after the task is run to completion. The action is invoked on the provided context. Overrides ContinueWith.
Public methodStatic member ContinueWith(IVsTask, VsTaskRunContext, VsTaskContinuationOptions, IVsTaskBody, Object) Uses the specified options to append to this task the provided action, to be run after the task is run to completion. The action is invoked on the provided context. Overrides ContinueWithEx.
Public methodStatic member CreateAndStartTask(IVsTaskSchedulerService, VsTaskRunContext, IVsTaskBody) Creates a Visual Studio task that's executed with the specified context.
Public methodStatic member CreateAndStartTask(IVsTaskSchedulerService, VsTaskRunContext, VsTaskBodyCallback) Creates a Visual Studio task that will be executed in the specified context.
Public methodStatic member CreateAndStartTask(IVsTaskSchedulerService, VsTaskRunContext, Action) Creates a Visual Studio task that will be executed in the specified context.
Public methodStatic member CreateAndStartTaskEx Creates a Visual Studio task that's executed with the specified context.
Public methodStatic member CreateTask(IVsTaskSchedulerService, VsTaskRunContext, IVsTaskBody) Creates a task that's 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(Func<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>(Func<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(VsTaskAwaiter) Internal use only. 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 GetAwaiter(IVsTask) Internal use only. Gets the task to be used for scheduling continuations.
Public methodStatic member InvokeAsync<T> Transforms a task parallel library (TPL) task from an asynchronous function into an IVsTask.
Public methodStatic member IsUIThreadContext Determines whether the specified context represents UI thread work.
Public methodStatic member ResumeWith Extension method for task awaiter to support awaits with a specific context.
Public methodStatic member RunAsync(JoinableTaskFactory, VsTaskRunContext, Func<Task>)
Public methodStatic member RunAsync<T>(JoinableTaskFactory, VsTaskRunContext, Func<Task<T>>)
Public methodStatic member RunAsyncAsVsTask<T>
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 correct enumeration types.
Public methodStatic member Yield(VsTaskRunContext, IVsTaskCompletionSource) Yields the current operation on the thread, so that the rest of the async method is scheduled as a continuation.
Public methodStatic member Yield(IVsTaskSchedulerService, VsTaskRunContext, IVsTaskCompletionSource) 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