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(); }
/// <summary> /// 初始化之前先初始化其他Set属性 /// </summary> public void Initialize() { if (this.maxMuteSpanInMinutes > 0) { this.agileCycleEngine = new CycleEngine(this); this.agileCycleEngine.DetectSpanInSecs = this.detectSpanInSecs; this.agileCycleEngine.Start(); } }
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(); }