Пример #1
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            _LabelHandler   = new setLabelHandler(this.setLabel);
            _Timer.Elapsed += new ReportEventHandler(_Timer_Elapsed);
            _Timer.Error   += new ExceptionEventHandler(Error);

            if (_Sync)
            {
                for (int i = 0; i < 60; ++i)
                {
                    _Timer.AddReportEvent(new ScheduledTime("ByMinute", "60,0"), 120 - i);
                    _Timer.AddReportEvent(new ScheduledTime("ByMinute", "60,0"), i);
                }
            }
            else
            {
                for (int i = 0; i < 60; ++i)
                {
                    _Timer.AddAsyncReportEvent(new ScheduledTime("ByMinute", "60,0"), 120 - i);
                    _Timer.AddAsyncReportEvent(new ScheduledTime("ByMinute", "60,0"), i);
                }
            }
            _Timer.AddReportEvent(new ScheduledTime("ByMinute", "30,0"), 60);
            _Timer.AddReportEvent(new ScheduledTime("ByMinute", "30,0"), 0);
        }
Пример #2
0
        void Form_Load(Object sender, EventArgs e)
        {
            _LabelHandler   = SetLabel;
            _Timer.Elapsed += Timer_Elapsed;
            _Timer.Error   += Error;


            if (_Sync)
            {
                for (var i = 0; i < 60; ++i)
                {
                    _Timer.AddReportEvent(new ScheduledTime("ByMinute", "60,0"), 120 - i);
                    _Timer.AddReportEvent(new ScheduledTime("ByMinute", "60,0"), i);
                }
            }
            else
            {
                for (var i = 0; i < 60; ++i)
                {
                    _Timer.AddAsyncReportEvent(new ScheduledTime("ByMinute", "60,0"), 120 - i);
                    _Timer.AddAsyncReportEvent(new ScheduledTime("ByMinute", "60,0"), i);
                }
            }
            _Timer.AddReportEvent(new ScheduledTime("ByMinute", "30,0"), 60);
            _Timer.AddReportEvent(new ScheduledTime("ByMinute", "30,0"), 0);
        }