private void Form1_Load(object sender, EventArgs e) { var Timer = new ScheduleTimer(); Timer.Elapsed += new ScheduledEventHandler(timer_Elapsed); Timer.AddEvent(new Schedule.ScheduledTime("BySecond", "5")); Timer.Start(); }
private void Form1_Load(object sender, System.EventArgs e) { timer = new ScheduleTimer(); timer.Elapsed += new ScheduledEventHandler(timer_Elapsed); // timer.EventStorage = new NullEventStorage(); timer.AddEvent(new ScheduledTime(EventTimeBase.BySecond, TimeSpan.FromSeconds(0))); }
protected override void OnEnabling(EnablingEventArgs e) { tickTimer = new ScheduleTimer(); tickTimer.Elapsed += AlarmHit; if (recurDaily) { tickTimer.AddEvent(new Schedule.ScheduledTime(EventTimeBase.Daily, new TimeSpan(0, hour, minute, second, 0))); } else { alarmTime = new DateTime(year, month, day, hour, minute, second); SingleEvent se = new SingleEvent(alarmTime); tickTimer.AddEvent(se); } tickTimer.Start(); }
protected override void OnStart(string[] args) { try { System.Diagnostics.Debugger.Launch(); ScheduleTimer Timer = new ScheduleTimer(); Timer.Elapsed += Timer_Elapsed; Timer.AddEvent(new ScheduledTime("Daily", AppSettingHelper.DailyJobTime)); Timer.Start(); } catch (Exception e) { } }