Example #1
0
 /// <summary>
 /// ��UI�߳���ͬ������ί�С�
 /// </summary>
 /// <param name="control"></param>
 /// <param name="invokeDelegate"></param>
 /// <param name="args"></param>
 /// <returns></returns>
 public object InvokeControlDelegate(Control control, ControlInvokeDelegate invokeDelegate, object[] args)
 {
     AsyncControlDelegateInvoker invoker = new AsyncControlDelegateInvoker();
     invoker.Blocking = true;
     invoker.Control = control;
     invoker.Args = args;
     invoker.InvokeDelegate = invokeDelegate;
     invoker.Execute();
     return invoker.Result;
 }
Example #2
0
 /// <summary>
 /// ��UI�߳��첽����ί�С�
 /// </summary>
 /// <param name="control"></param>
 /// <param name="invokeDelegate"></param>
 /// <param name="args"></param>
 /// <returns></returns>
 public IAsyncResult BeginInvokeControlDelegate(Control control, ControlInvokeDelegate invokeDelegate, object[] args)
 {
     AsyncControlDelegateInvoker invoker = new AsyncControlDelegateInvoker();
     invoker.Blocking = false;
     invoker.Control = control;
     invoker.Args = args;
     invoker.InvokeDelegate = invokeDelegate;
     invoker.Execute();
     return invoker.State;
 }