private static bool IsSatisfied(TimeCriteria criterion)
        {
            switch (criterion)
            {
            case TimeCriteria.OnWeekend:
                return(TimeService.IsWeekend());

            case TimeCriteria.OutsideWeekend:
                return(TimeService.IsOutsideWeekend());

            case TimeCriteria.AtNight:
                return(TimeService.IsNight());

            case TimeCriteria.DuringDay:
                return(TimeService.IsDay());

            default:
                throw new ArgumentOutOfRangeException("criterion");
            }
        }
Example #2
0
 public CriteriaArray CreateArray(SpeedCriteria speedCriteria, TimeCriteria timeCriteria)
 {
     return(new CriteriaArray(new [] { speedCriteria as ICriteria, timeCriteria }));
 }