Beispiel #1
0
        private void Worker(object state)
        {
            DateTime now = DateTime.Now;

            lock (this.locker)
            {
                foreach (TimingTask task in this.taskList)
                {
                    if (task.IsOnTime(this.timerSpanInSecs, now))
                    {
                        CbDateTime cb = new CbDateTime(task.TimingTaskExcuter.ExcuteOnTime);
                        cb.BeginInvoke(now, null, null); //异步执行任务
                    }
                }
            }
        }
        private void Worker(object state)
        {
            DateTime now = DateTime.Now;

            lock (this.locker)
            {
                foreach (TimingTask task in this.taskList)
                {
                    if (task.IsOnTime(this.timerSpanInSecs, now))
                    {
                        CbDateTime cb = new CbDateTime(task.TimingTaskExcuter.ExcuteOnTime);
                        cb.BeginInvoke(now, null, null); //异步执行任务
                    }
                }
            }          
        }