示例#1
0
 private void zClearScheduler()
 {
     if (m_Scheduler != null)
     {
         m_Scheduler.Dispose();
         gbScheduler.Controls.Clear();
         m_Scheduler = null;
     }
 }
示例#2
0
        private void zUpdateScheduler()
        {
            if (rbOneTime.Checked && !(m_Schedule is OneTimeSchedule))
            {
                m_Schedule = new OneTimeSchedule();
            }
            if (rbHourly.Checked && !(m_Schedule is HourlySchedule))
            {
                m_Schedule = new HourlySchedule()
                {
                    HourlyRecurrence = TimeSpan.FromHours(1)
                };
            }
            if (rbDaily.Checked && !(m_Schedule is DailySchedule))
            {
                m_Schedule = new DailySchedule()
                {
                    DailyRecurrence         = 1,
                    DailyRepetitionInterval = TimeSpan.FromHours(1)
                };
            }
            if (rbWeekly.Checked && !(m_Schedule is WeeklySchedule))
            {
                m_Schedule = new WeeklySchedule()
                {
                    DailyRepetitionInterval = TimeSpan.FromHours(1)
                };
            }
            if (rbMonthly.Checked && !(m_Schedule is MonthlySchedule))
            {
                m_Schedule = new MonthlySchedule()
                {
                    MonthlyRecurrenceType   = MonthlyRecurrenceType.OrdinalDays,
                    DailyRepetitionInterval = TimeSpan.FromHours(1)
                };
            }

            zClearScheduler();
            if (!(m_Schedule is OneTimeSchedule))
            {
                m_Scheduler      = SchedulerFactory.GetScheduler(m_Schedule);
                m_Scheduler.Dock = DockStyle.Fill;
                gbScheduler.Controls.Add(m_Scheduler);
            }
        }