Example #1
0
        public void RunPrimaryTastListOnlineWrite(TaskList taskList, ProcessTaskHandler processTaskHandler,ProcessErrorHandler errorTaskHandler,ProcessErrorHandler logTaskHandler)
        {
            isPrimary = true;
            //taskList.EndTaskWritte += processTaskHandler;
            //taskList.ErrorTaskWritte+=errorTaskHandler;
            //if (logTaskHandler != null)
            //	taskList.LogTaskWritte+= logTaskHandler;

            foreach (ITask task in taskList.TasksList){
                task.ErrorWrite+=errorTaskHandler;
                task.EndTaskWrite +=processTaskHandler;
                if (logTaskHandler != null)
                    task.LogWrite+= logTaskHandler;
            }

            taskList.ExecuteTaskOnlineWrite();
            isPrimary = false;
        }
Example #2
0
        public void RunPrimaryTastListOnlineWrite(TaskList taskList, ProcessTaskHandler processTaskHandler, ProcessErrorHandler errorTaskHandler, ProcessErrorHandler logTaskHandler)
        {
            isPrimary = true;
            //taskList.EndTaskWritte += processTaskHandler;
            //taskList.ErrorTaskWritte+=errorTaskHandler;
            //if (logTaskHandler != null)
            //	taskList.LogTaskWritte+= logTaskHandler;

            foreach (ITask task in taskList.TasksList)
            {
                task.ErrorWrite   += errorTaskHandler;
                task.EndTaskWrite += processTaskHandler;
                if (logTaskHandler != null)
                {
                    task.LogWrite += logTaskHandler;
                }
            }


            taskList.ExecuteTaskOnlineWrite();
            isPrimary = false;
        }
Example #3
0
        private TaskList secondTaskList;        //

        public void SecondTaskThreadRun()
        {
            try {
                while (play)
                {
                    if ((!isPrimary) && (!isBussy) && (secondTaskList != null))
                    {
                        isBussy = true;
                        lock (secondTaskList) {
                            //Console.WriteLine("secondTaskList THREAD RUNING");
                            //secondTaskList.ExecuteTask();
                            secondTaskList.ExecuteTaskOnlineWrite();
                            secondTaskList = null;
                        }
                        //Thread.Sleep (1000);
                        isBussy = false;
                    }
                    Thread.Sleep(500);
                }
            } catch (ThreadAbortException) {
                Thread.ResetAbort();
            }
        }