Exemplo n.º 1
0
        public void Edit(ICalendarTimer timer)
        {
            EveryDayTimer everyDayTimer = (EveryDayTimer)timer;

            dateTimeTime.Value = everyDayTimer.EventTime;
            foreach (CheckBox checkBox in tableTimer.Controls.Cast <Control>().Where(c => c.Tag is DayOfWeek))
            {
                checkBox.Checked = everyDayTimer.ActiveWeekDays.Contains((DayOfWeek)checkBox.Tag);
            }
        }
Exemplo n.º 2
0
        public void Save(ICalendarTimer timer)
        {
            EveryDayTimer everyDayTimer = (EveryDayTimer)timer;

            everyDayTimer.EventTime      = dateTimeTime.Value;
            everyDayTimer.ActiveWeekDays = tableTimer
                                           .Controls
                                           .Cast <Control>()
                                           .Where(c => c.Tag is DayOfWeek)
                                           .Cast <CheckBox>()
                                           .Where(c => c.Checked)
                                           .Select(c => (DayOfWeek)c.Tag)
                                           .ToArray();
        }