Пример #1
0
        private IScheduleElem CreateDefault(ScheduleElemLevel level)
        {
            switch (level)
            {
            case ScheduleElemLevel.Week:
                return(defaultFactory.GetWeek());

            case ScheduleElemLevel.Day:
                return(defaultFactory.GetDay());

            case ScheduleElemLevel.Undefined:
                return(defaultFactory.GetUndefined());

            default:
                throw new ArgumentOutOfRangeException($"Cannot create default for {level}");
            }
        }
Пример #2
0
        public MergeStrategy GetStrategy(ScheduleElemLevel level)
        {
            switch (level)
            {
            case ScheduleElemLevel.Week:
                return(new WeekMergeStrategy(this));

            case ScheduleElemLevel.Day:
                return(new DayMergeStrategy(this, dmLogger));

            case ScheduleElemLevel.Undefined:
                return(new UndefinedMergeStrategy(this));

            default:
                throw new NotImplementedException();
            }
        }