Waits for an event of type T that causes checkEventFunc to return true. Returns null if timeout is reached first.

Namespace: BaseLib
Assembly: BaseLib (in BaseLib.dll) Version: 0.5.0.0

Syntax

C#
T WaitFor<T>(
	Func<T, bool> checkEventFunc,
	double timeout
)
where T : EventBase

Parameters

checkEventFunc
Type: System..::..Func<(Of <(<'T, Boolean>)>)>
Event filter function. Should return true if the event is what you are looking for, otherwise false.
timeout
Type: System..::..Double
The timeout value, in seconds.

Type Parameters

T
The type of event to look for.

Return Value

The event matching type T, or null if timeout is reached first.

See Also