protected TimerBase(SerializationInfo info, StreamingContext context) { _id = (TimerId)info.GetValue("id", typeof(TimerId)); _startTime = (Time?)info.GetValue("t", typeof(Time?)); _interval = (Minute)info.GetValue("i", typeof(Minute)); _schedules = (Dictionary<Minute, Action>)info.GetValue("s", typeof(Dictionary<Minute, Action>)); _timerDelegate = new TimerCallback(this.Execute); }
protected TimerBase(Uri uri) { if(null == uri) throw new ArgumentNullException("uri"); _id = new TimerId(uri.ToString()); _schedules = new Dictionary<Minute, Action>(); _timers = new Dictionary<Minute, ThreadingTimer>(); _timerDelegate = new TimerCallback(this.Execute); }