public void DispatchPendingEvents() { try { toolkit.ExitUserCode(null); toolkit.Backend.DispatchPendingEvents(); } finally { toolkit.EnterUserCode(); } }
public static void DispatchPendingEvents() { try { Toolkit.ExitUserCode(null); engine.DispatchPendingEvents(); } finally { Toolkit.EnterUserCode(); } }
/// <summary> /// Invokes an action in the GUI thread /// </summary> /// <param name='action'> /// The action to execute. /// </param> public static void Invoke(Action action) { engine.Invoke(delegate { try { Toolkit.EnterUserCode(); action(); Toolkit.ExitUserCode(null); } catch (Exception ex) { Toolkit.ExitUserCode(ex); } }); }
/// <summary> /// Invokes an action in the GUI thread after the provided time span /// </summary> /// <returns> /// A timer object /// </returns> /// <param name='action'> /// The action to execute. /// </param> /// <remarks> /// This method schedules the execution of the provided function. The function /// must return 'true' if it has to be executed again after the time span, or 'false' /// if the timer can be discarded. /// The execution of the funciton can be canceled by disposing the returned object. /// </remarks> public static IDisposable TimeoutInvoke(TimeSpan timeSpan, Func <bool> action) { Timer t = new Timer(); t.Id = engine.TimeoutInvoke(delegate { bool res = false; try { Toolkit.EnterUserCode(); res = action(); Toolkit.ExitUserCode(null); } catch (Exception ex) { Toolkit.ExitUserCode(ex); } return(res); }, timeSpan); return(t); }
public static void InitializeAsGuest(ToolkitType type) { Initialize(type); toolkit.ExitUserCode(null); }