次の方法で共有


IVsTaskCompletionSource Interface

Definition

Interacts with a task completion source to set its state and get the internal IVsTask instance.

public interface class IVsTaskCompletionSource
public interface class IVsTaskCompletionSource
__interface IVsTaskCompletionSource
public interface IVsTaskCompletionSource
[System.Runtime.InteropServices.Guid("CE465203-16BC-4EBD-B4D1-9B4416B80931")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsTaskCompletionSource
type IVsTaskCompletionSource = interface
[<System.Runtime.InteropServices.Guid("CE465203-16BC-4EBD-B4D1-9B4416B80931")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsTaskCompletionSource = interface
Public Interface IVsTaskCompletionSource
Attributes

Remarks

This interface is safe to access from any thread.

Properties

Task

Gets the task owned by this source.

Methods

AddDependentTask(IVsTask)

Adds the specified task to the task completion sources dependent task list. Then if Wait() is called on IVsTaskCompletionSource.Task, the UI can be unblocked correctly.

SetCanceled()

Sets the task owned by this source to cancelled state, also cancelling the task.

SetFaulted(Int32)

Sets the task owned by this source to the faulted state (with the given HRESULT code).

SetResult(Object)

Sets the task owned by this source to completed state with the result.

Extension Methods

CompleteAfterTask<T>(IVsTaskCompletionSource, Task<T>)

Sets a continuation on the task passed in so that task completion source is set to correct state after the task is completed/faulted or canceled.

Applies to