Пример #1
0
 public void RegisterTask(TimingTask task)
 {
     lock (this.locker)
     {
         this.taskList.Add(task);
     }
 }
Пример #2
0
 public void UnRegisterTask(TimingTask task)
 {
     lock (this.locker)
     {
         this.taskList.Remove(task);
     }
 }
Пример #3
0
        public TimeTaskInvoke(ITimingTaskExcuter taskExcuter, TimingTaskType timingTaskType)
        {
            TimingTask task = new TimingTask();//如果多种定时任务 多创建几个TimeingTask 注册到TimingTaskManager

            task.TimingTaskType    = timingTaskType;
            task.TimingTaskExcuter = taskExcuter;
            task.ExcuteTime        = new ShortTime(0, 0, 1);
            TimingTaskManager timeTask = new TimingTaskManager();

            timeTask.RegisterTask(task);
            timeTask.Initialize();
        }