Пример #1
0
        public ATimer(int timerType, int intervalMS, ElapsedTimerDelegate callback)
        {
            _timerType = timerType;

            _interval = intervalMS;

            _elapsedTimerHandler = callback;

            if (timerType == 0)
            {
                _elapsedTimer0Handler = Timer0Handler;
            }
            else if (timerType == 1)
            {
                _elapsedTimer1Handler = Timer1Handler;

                _timer1 = new System.Windows.Forms.Timer();

                _timer1.Interval = _interval;

                _timer1.Tick += Timer1Handler;
            }
            else if (timerType == 2)
            {
                _timer2 = new MicroTimer();

                _timer2.Interval = _interval * 1000;

                _timer2.MicroTimerElapsed += Timer2Handler;
            }
            else if (timerType == 3)
            {
            }
        }
Пример #2
0
        public ATimer(int timerType, int intervalMS, ElapsedTimerDelegate callback)
        {
            _timerType = timerType;

            _interval = intervalMS;

            _elapsedTimerHandler = callback;

            if (timerType == 0)
            {
                _elapsedTimer0Handler = Timer0Handler;
            }
            else if (timerType == 1)
            {
                _elapsedTimer1Handler = Timer1Handler;

                _timer1 = new System.Windows.Forms.Timer();

                _timer1.Interval = _interval;

                _timer1.Tick += Timer1Handler;
            }
            else if (timerType == 2)
            {
                _timer2 = new MicroTimer();

                _timer2.Interval = _interval * 1000;

                _timer2.MicroTimerElapsed += Timer2Handler;

            }
            else if (timerType == 3)
            {
            }
        }