IVsTask Interface
Provides methods that interact with a task, such as starting it, cancelling it, or appending continuations.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assemblies: Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
Microsoft.VisualStudio.Shell.Interop.11.0 (in Microsoft.VisualStudio.Shell.Interop.11.0.dll)
Microsoft.VisualStudio.Shell.Immutable.11.0 (in Microsoft.VisualStudio.Shell.Immutable.11.0.dll)
Syntax
'Declaration
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
<GuidAttribute("0B98EAB8-00BB-45D0-AE2F-3DE35CD68235")> _
Public Interface IVsTask
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
[GuidAttribute("0B98EAB8-00BB-45D0-AE2F-3DE35CD68235")]
public interface IVsTask
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)]
[GuidAttribute(L"0B98EAB8-00BB-45D0-AE2F-3DE35CD68235")]
public interface class IVsTask
[<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)>]
[<GuidAttribute("0B98EAB8-00BB-45D0-AE2F-3DE35CD68235")>]
type IVsTask = interface end
public interface IVsTask
The IVsTask type exposes the following members.
Properties
Name | Description | |
---|---|---|
AsyncState | Gets the asynchronous state object that was given when the task was created. | |
Description | Gets or sets the description for the text that is displayed for component diagnostics. | |
IsCanceled | Gets whether the task group is cancelled. If true, the task group is cancelled. | |
IsCompleted | Gets whether the task result is available. If true, the task result is available. If false, a GetResult call is blocked until the task is completed. | |
IsFaulted | Gets whether the task completed with an exception. If true, an exception occurred. |
Top
Methods
Name | Description | |
---|---|---|
_VtblGap1_2 | ||
_VtblGap2_1 | ||
AbortIfCanceled | Aborts the task if the task has been cancelled. Use this method to return from a cancelled task. | |
Cancel | Cancels the task group. An antecedent task and all of its children share the same cancellation token, so cancelling any of the tasks cancels the whole task group. | |
ContinueWith | 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. | |
ContinueWithEx | 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. | |
GetResult | Waits for the task to complete (not including any continuations) and returns the result set by the task. If the task returns an error code or an exception, this method returns the same error code. | |
Start | Starts the task. | |
Wait | Waits for the task to complete (not including any continuations). If the task returns an error code or an exception, this method returns the same error code. | |
WaitEx | Waits for the task to complete (not including any continuations). You can either specify a timeout (or INFINITE) or set the option to abort on task cancellation. |
Top
Extension Methods
Name | Description | |
---|---|---|
ApplyCancellationToken | Signals a Visual Studio task to cancel operations as soon as possible when the specified token is canceled. (Defined by VsTaskLibraryHelper.) | |
ContinueWith(VsTaskRunContext, IVsTaskBody) | Overloaded. 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. (Defined by VsTaskLibraryHelper.) | |
ContinueWith(VsTaskRunContext, VsTaskContinuationOptions, IVsTaskBody, Object) | Overloaded. 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. (Defined by VsTaskLibraryHelper.) | |
GetAwaiter | Internal use only. Gets the task to be used for scheduling continuations. (Defined by VsTaskLibraryHelper.) | |
ResumeWith | Extension method for task awaiter to support awaits with a specific context. (Defined by VsTaskLibraryHelper.) | |
Wait(Int32) | Overloaded. Waits for the task to complete (not including any continuations). Override for WaitEx with default options. (Defined by VsTaskLibraryHelper.) | |
Wait(Int32, VsTaskWaitOptions) | Overloaded. Waits for the task to complete (not including any continuations). Override for WaitEx to use correct enumeration types. (Defined by VsTaskLibraryHelper.) |
Top