Beispiel #1
0
 private void SetAlarmTimer()
 {
     _AlarmTimer.Stop();
     _AlarmTimer.ClearJobs();
     _AlarmTimer.AddJob(AlarmTime, new TickHandler(_AlarmTimer_Elapsed));
     _AlarmTimer.Start();
 }
Beispiel #2
0
 void ItmAlarm_Click(object sender, EventArgs e)
 {
     try
     {
         _AlarmDialog.SetSchedule(GetSetting("alarm", "Daily|4:30 PM"));
         if (_AlarmDialog.ShowDialog(this) == DialogResult.OK)
         {
             IScheduledItem Item = _AlarmDialog.GetSchedule();
             SetSetting("alarm", _AlarmDialog.GetScheduleString());
             _AlarmTimer.Stop();
             _AlarmTimer.ClearJobs();
             _AlarmTimer.AddJob(Item, new TickHandler(AlarmTimer_Elapsed));
             _AlarmTimer.Start();
         }
     }
     catch (Exception ex)
     {
         Startup.HandleException(ex);
     }
 }