This documentation is archived and is not being maintained.

UITestControl.WaitForCondition<T> Method (T, Predicate<T>, Int32)

Blocks the current thread until the specified condition is met, or until the specified time-out expires.

Namespace:  Microsoft.VisualStudio.TestTools.UITesting
Assembly:  Microsoft.VisualStudio.TestTools.UITesting (in Microsoft.VisualStudio.TestTools.UITesting.dll)

public static bool WaitForCondition<T>(
	T conditionContext,
	Predicate<T> conditionEvaluator,
	int millisecondsTimeout
)

Type Parameters

T

The Type that specifies the Type for the condition and predicate.

Parameters

conditionContext
Type: T
The context to evaluate the condition.
conditionEvaluator
Type: System.Predicate<T>
The delegate to evaluate the condition.
millisecondsTimeout
Type: System.Int32
The number of milliseconds before time-out.

Return Value

Type: System.Boolean
true if the condition is met before the time-out; otherwise, false.

Show: