Ejemplo n.º 1
0
        private void timerAlarm_Tick(object sender, EventArgs e)
        {
            DateTime now = DateTime.Now;

            ICalendarTimer[] activeTimers = timerCommandHandler.Timers.Where(t => t.Enabled && t.TestAndActive()).ToArray();
            if (activeTimers.Length > 0)
            {
                if (alarmForm == null)
                {
                    alarmForm             = new CalendarTimerAlarmForm();
                    alarmForm.FormClosed += new FormClosedEventHandler(alarmForm_FormClosed);
                    alarmForm.Show();
                }
                foreach (ICalendarTimer timer in activeTimers)
                {
                    alarmForm.AddTimer(now, timer);
                }
            }
        }
Ejemplo n.º 2
0
 private void alarmForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     alarmForm = null;
 }