Exemplo n.º 1
0
        public void Initialize()
        {
            if (this.taskDictionary.Count < 2)
            {
                throw new Exception("Count of StartHour must >= 2 !");
            }
            List <ShortTime> list = new List <ShortTime>();

            foreach (ShortTime current in this.taskDictionary.Keys)
            {
                list.Add(current);
            }
            list.Sort();
            this.taskTimeCircle = new Circle <ShortTime>(list);
            ShortTime shortTime = new ShortTime(DateTime.Now);

            if (shortTime.CompareTo(this.taskTimeCircle.Tail) >= 0 || shortTime.CompareTo(this.taskTimeCircle.Header) < 0)
            {
                this.taskTimeCircle.SetCurrent(this.taskTimeCircle.Tail);
            }
            else
            {
                this.taskTimeCircle.SetCurrent(this.taskTimeCircle.Header);
                while (shortTime.CompareTo(this.taskTimeCircle.PeekNext()) >= 0)
                {
                    this.taskTimeCircle.MoveNext();
                }
            }
            this.agileCycleEngine = new CycleEngine(this);
            this.agileCycleEngine.DetectSpanInSecs = 1;
            this.agileCycleEngine.Start();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化之前先初始化其他Set属性
 /// </summary>
 public void Initialize()
 {
     if (this.maxMuteSpanInMinutes > 0)
     {
         this.agileCycleEngine = new CycleEngine(this);
         this.agileCycleEngine.DetectSpanInSecs = this.detectSpanInSecs;
         this.agileCycleEngine.Start();
     }
 }
Exemplo n.º 3
0
 public void Initialize()
 {
     if (this.refreshSpanInSecs <= 0)
     {
         throw new Exception("RefreshSpanInSecs Property must be greater than 0 !");
     }
     foreach (IRefreshableCache current in this.cacheList)
     {
         current.LastRefreshTime = DateTime.Now;
     }
     this.agileCycleEngine = new CycleEngine(this);
     this.agileCycleEngine.DetectSpanInSecs = 1;
     this.agileCycleEngine.Start();
 }