Compartir a través de


IVsTask.WaitEx Method

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.

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)

Syntax

'Declaration
Function WaitEx ( _
    millisecondsTimeout As Integer, _
    options As UInteger _
) As Boolean
bool WaitEx(
    int millisecondsTimeout,
    uint options
)
bool WaitEx(
    [InAttribute] int millisecondsTimeout, 
    [InAttribute] unsigned int options
)
abstract WaitEx : 
        millisecondsTimeout:int * 
        options:uint32 -> bool
function WaitEx(
    millisecondsTimeout : int, 
    options : uint
) : boolean

Parameters

  • millisecondsTimeout
    Type: Int32

    The timeout (in milliseconds) or INFINITE.

  • options
    Type: UInt32

    Values are of type __VSTASKWAITOPTIONS. Set to VSTWO_AbortOnTaskCancellation to abort if a cancellation occurs.

Return Value

Type: Boolean
true if the task completed successfully before millisecondsTimeout, otherwise false.

Remarks

If the task returns an error code or an exception, this method returns the same error code. If the task does not complete before the time out, S_OK will be returned with pTaskCompleted set to false.

This method can return VS_E_CIRCULARTASKDEPENDENCY if the task library determines that the call would result in a deadlock. It may also return VS_E_TASKSCHEDULERFAIL, or TaskSchedulingException if the task library was not able to schedule one of the tasks that was required to complete the awaited task.

.NET Framework Security

See Also

Reference

IVsTask Interface

Microsoft.VisualStudio.Shell.Interop Namespace