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
        }
示例#2
0
 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);
         }
     }
 }
示例#4
0
 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);
 }
示例#6
0
 public abstract void Post(HouseDelegate method);
示例#7
0
 public override void Post(HouseDelegate method)
 {
     AddTask(new MethodTask(method, null));
 }