public void Await(HouseDelegate method) { var frame = new DispatcherFrame(); this.Post(() => { method(); frame.Continue = false; }); Dispatcher.PushFrame(frame); // start the secondary dispatcher, pausing this code }
static public void Invoke(HouseDelegate method) { if (method != null) { if (method.Target is IHouseDispatcher) { (method.Target as IHouseDispatcher).Dispatcher.Post(method); } else { method.Method.Invoke(method.Target, null); } } }
public override void Post(HouseDelegate method) { if (method != null) { if (fUI.CheckAccess()) { method.Method.Invoke(method.Target, null); } else { fUI.BeginInvoke(method); } } }
public override void Post(HouseDelegate method) { if (method != null) { if (fUI.InvokeRequired) { fUI.BeginInvoke(method); } else { method.Method.Invoke(method.Target, null); } } }
static public void BeginAsync(HouseDelegate method) { System.Windows.Application.Current.Dispatcher.BeginInvoke(method); }
public abstract void Post(HouseDelegate method);
public override void Post(HouseDelegate method) { AddTask(new MethodTask(method, null)); }