Ejemplo n.º 1
0
        static void CallbackMethod(IAsyncResult result)
        {
            AsyncResult         ar     = (AsyncResult)result;
            ExecuteFuncDelegate caller = (ExecuteFuncDelegate)ar.AsyncDelegate;

            CELBase task = (CELBase)ar.AsyncState;

            if (task.target != null)
            {
                if (task.target is Control)
                {
                    CELAsyncResultReceiverTaskMethod method = new CELAsyncResultReceiverTaskMethod(task.target.TaskFinished);
                    Control ctrl = task.target as Control;
                    while (!ctrl.IsHandleCreated)
                    {
                        System.Threading.Thread.Sleep(100);
                    }
                    ctrl.Invoke(method, task);
                }
                else
                {
                    task.target.TaskFinished(task);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// needs to be executed on thread of Control
 /// </summary>
 /// <param name="task"></param>
 public void FlushResultsToControlSync(CELBase task)
 {
     /*listControl.BeginUpdate();
      *
      * foreach (Results res in ResultsList)
      * {
      *  listControl.Items.Add(res);
      * }
      * ResultsList.Clear();
      * listControl.EndUpdate();*/
 }
Ejemplo n.º 3
0
 /// <summary>
 /// needs to be executed on thread of Control
 /// </summary>
 /// <param name="task"></param>
 public void ClearControlListSync(CELBase task)
 {
     //listControl.Items.Clear();
 }