2012年9月25日
摘要: 1.引言Scheduled Timer将定时器Timer进行封装成ScheduledTimer,很多Timer暴露的成员,都以私有化,并将上一节中的定时器作业(TimerJob)进行了集成。2.ScheduledTimer代码很简单,直接上代码 public class ScheduleTimer { public IEventStorage EventStorage = new LocalEventStorage(); public event ExceptionEventHandler Error; private static Tim... 阅读全文
posted @ 2012-09-25 17:28 Qlin 阅读(1970) 评论(0) 推荐(1) 编辑
摘要: 1.引言实际应用中,我们是定义一个作业,定时器然后定时去调用。前面章节都介绍的时间调度、事件过滤(EventFilter)、任务方法(MethodCall) 这些都是这个作业零部件,这就是这节要介绍的Job。2.JobScheduled Timer的Job是由时间调度器、任务方法,事件过滤器等组成,共同来达到预期的目的,单个不行,好像一个团队,主要代码如下 /// <summary> /// 定时器作业 /// </summary> public class TimerJob { public IScheduledItem Schedule; ... 阅读全文
posted @ 2012-09-25 09:13 Qlin 阅读(2172) 评论(9) 推荐(1) 编辑