Udostępnij za pośrednictwem


IApp.WaitFor Metoda

Definicja

Ogólna funkcja wait, która będzie powtarzać wywołanie predicate funkcji, dopóki nie zwróci wartości true. TimeoutException Zgłasza wartość , jeśli predykat nie jest pełny w limicie czasu.

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)

Parametry

predicate
Func<Boolean>

Funkcja Predykate, która powinna zwracać true wynik po zakończeniu oczekiwania.

timeoutMessage
String

Komunikat użyty w elemecie TimeoutException.

timeout
Nullable<TimeSpan>

Przed TimeSpan niepowodzeniem należy zaczekać.

retryFrequency
Nullable<TimeSpan>

Oczekiwanie TimeSpan między każdym wywołaniem predykatu.

postTimeout
Nullable<TimeSpan>

Końcowy czas TimeSpan oczekiwania po zdaniu predykatu zwraca wartość true.

Dotyczy