public static bool Run(WaitHandle handle, TimeSpan until) { DateTime then = DateTime.Now + until; MessagePump.Instance.RunUntil(() => MessagePump.IsDone(handle, then)); if (handle != null) { return(handle.WaitOne(0)); } return(false); }
/// <summary> /// Process all asynchronous messages. /// This must be called periodically by the application at a frequency of no less than every 100ms. /// </summary> public static void RunOnce() { MessagePump.Instance.RunUntil(() => MessagePump.IsDone(null, DateTime.Now)); }