Example #1
0
 public static void executeTask(ITask task, Control controlToHostTask,
                                TaskEvents.TaskEvent_StatusChanged onTaskStatusChange)
 {
     if (controlToHostTask != null && controlToHostTask.InvokeRequired)
         controlToHostTask.Invoke(new EventHandler(delegate
                                                       {
                                                           executeTask(task, controlToHostTask,
                                                                       onTaskStatusChange);
                                                       }));
     else
     {
         task.onTaskStatusChange += onTaskStatusChange;
         var taskControl = new ascx_Task(new TaskThread(task));
         if (controlToHostTask != null)
             controlToHostTask.Controls.Add(taskControl);
         taskControl.startTask();
     }
 }
Example #2
0
        public static void executeTask(ITask task, Control controlToHostTask,
                                       TaskEvents.TaskEvent_ResultsObject onTaskExecutionCompletion)
        {
            if (controlToHostTask != null && controlToHostTask.InvokeRequired)
                controlToHostTask.Invoke(new EventHandler(delegate
                                                              {
                                                                  executeTask(task, controlToHostTask,
                                                                              onTaskExecutionCompletion);
                                                              }));
            else
            {
                task.onTaskExecutionCompletion += onTaskExecutionCompletion;

                var taskControl = new ascx_Task(new TaskThread(task));
                if (controlToHostTask != null)
                    controlToHostTask.Controls.Add(taskControl);
                taskControl.startTask();
            }
        }
Example #3
0
 public static void executeTask(ITask task, TaskEvents.TaskEvent_ResultsObject onTaskExecutionCompletion)
 {
     executeTask(task, null, onTaskExecutionCompletion);
 }
Example #4
0
 public static void executeTask(ITask task, TaskEvents.TaskEvent_StatusChanged onTaskStatusChange)
 {
     executeTask(task, null, onTaskStatusChange);
 }