예제 #1
0
        public static RecordSchedule CreateWithDefaultValues(RecordScheduleKind kind)
        {
            RecordSchedule schedule;

            switch (kind)
            {
            case RecordScheduleKind.RightNow: schedule = new RecordRightNow(); break;

            case RecordScheduleKind.OneTime: schedule = new RecordOneTime(); break;

            case RecordScheduleKind.Daily: schedule = new RecordDaily(); break;

            case RecordScheduleKind.Weekly: schedule = new RecordWeekly(); break;

            case RecordScheduleKind.Monthly: schedule = new RecordMonthly(); break;

            default:
                throw new IndexOutOfRangeException();
            } // switch
            schedule.SetDefaultValues();

            return(schedule);
        } // CreateWithDefaultValues
예제 #2
0
        } // ToRecordWeekDays

        public override void SetDefaultValues()
        {
            base.SetDefaultValues();
            RecurEveryWeeks = 1;
            WeekDays        = RecordWeekly.ToRecordWeekDays(DateTime.Now.DayOfWeek);
        } // SetDefaultValues