Ejemplo n.º 1
0
 public static SequenceController CreateController(DateTime startDate, IRecurrenceStrategy strategy, DateTime?endDate = null, int?numberOfOccurrences = null)
 {
     if (strategy == null)
     {
         throw new ArgumentNullException("strategy");
     }
     return(new SequenceController(startDate, strategy, endDate, numberOfOccurrences));
 }
Ejemplo n.º 2
0
        public SequenceController(DateTime startDate, IRecurrenceStrategy strategy, DateTime?endDate = null, int?numberOfOccurrences = null)
        {
            if (strategy == null)
            {
                throw new ArgumentNullException("strategy");
            }
            if (numberOfOccurrences <= 0)
            {
                throw new ArgumentOutOfRangeException("numberOfOccurrences");
            }

            _startDate           = startDate.Date;
            _strategy            = strategy;
            _endDate             = endDate.HasValue ? endDate.Value.Date : (DateTime?)null;
            _numberOfOccurrences = numberOfOccurrences;

            _strategy.SetStartDate(startDate);
        }