Пример #1
0
        public void ExecuteTask()
        {
            if (gCurrentTask != null || gTaskList.Count == 0)
            {
                return;
            }
            //gCurrentTask = gTaskList[0];
            //gTaskList.RemoveAt(0);
            //////////////////////////////gCurrentTask.EndFunction += new TaskEndFunction(EndTask);
            //gCurrentTask.TaskEnded += new TaskEventHandler(EndTask);
            //ThreadStart ts = new ThreadStart(gCurrentTask.ExecuteTask);
            //gCurrentTaskThread = new Thread(ts);
            //gCurrentTaskThread.Start();
            ThreadStart ts = new ThreadStart(ExecuteTaskThread);

            gThread = new Thread(ts);
            ApplicationThreads.Add(gThread, this);
            gThread.Start();
        }
Пример #2
0
 public void TaskEnded(ITask task)
 {
     ApplicationThreads.Remove(this);
 }