IApp.WaitFor 方法

定义

将重复调用函数的泛型 wait 函数, predicate 直到返回 trueTimeoutException如果谓词未在时间限制内完全填充,则引发 。

public void WaitFor (Func<bool> predicate, string timeoutMessage = "Timed out waiting...", Nullable<TimeSpan> timeout = null, Nullable<TimeSpan> retryFrequency = null, Nullable<TimeSpan> postTimeout = null);
abstract member WaitFor : Func<bool> * string * Nullable<TimeSpan> * Nullable<TimeSpan> * Nullable<TimeSpan> -> unit
Public Sub WaitFor (predicate As Func(Of Boolean), Optional timeoutMessage As String = "Timed out waiting...", Optional timeout As Nullable(Of TimeSpan) = null, Optional retryFrequency As Nullable(Of TimeSpan) = null, Optional postTimeout As Nullable(Of TimeSpan) = null)

参数

predicate
Func<Boolean>

等待完成时应返回 true 的谓词函数。

timeoutMessage
String

在 中使用的 TimeoutException消息。

timeout
Nullable<TimeSpan>

TimeSpan 失败之前等待的 。

retryFrequency
Nullable<TimeSpan>

每次 TimeSpan 调用谓词之间要等待的 。

postTimeout
Nullable<TimeSpan>

在谓词返回 后要等待的最后 TimeSpan 一个 true

适用于