public Counter Add(TimerKey name, int startValue, int direction, int step, TimerCounterType type) { Counter newTimer = new SuperCounter(direction, startValue, step, type); this.timers.Add(name.ToString(), newTimer); return(newTimer); }
public Counter(int direction, int start_value, int step, TimerCounterType type) { //this.myTimer = new TimerSerializable(step); this.myTimer = new Timer(step); this.myTimer.AutoReset = true; this.myTimer.Enabled = false; this.myTimer.Elapsed += new ElapsedEventHandler(timer_Elapsed); this.offset = start_value; this.type = type; if (direction == 0) { this.mult = 1; } else { this.mult = -1; } this.Reset(); }
public SuperCounter(int direction, int start_value, int step, TimerCounterType type) : base(direction, start_value, step, type) { this.startPoint = DateTime.Now; this.myTimer.Elapsed += new ElapsedEventHandler(timer_Elapsed); }