Exemple #1
0
        private Holiday FixedHoliday(string descrizione, AgnosticDay agnosticDay, int currentYear)
        {
            var dateTime = new DateTime(currentYear, agnosticDay.Month, agnosticDay.Day);

            return
                (Holiday.Fixed(descrizione, dateTime));
        }
Exemple #2
0
        public void Check(AgnosticDay agnosticDay)
        {
            if (holidayList.Any(holiday => holiday.Date.Month > agnosticDay.Month))
            {
                throw new ArgumentException();
            }

            if (holidayList.Any(holiday => holiday.Date.Month == agnosticDay.Month && holiday.Date.Day > agnosticDay.Day))
            {
                throw new ArgumentException();
            }
        }
Exemple #3
0
        public Holidays Fixed(string name, AgnosticDay agnosticDay)
        {
            holidayEntries.Check(agnosticDay);

            var holidays =
                Enumerable
                .Range(startingYear, futureYears)
                .Select(currentYear => FixedHoliday(name, agnosticDay, currentYear))
                .ToList();

            holidayEntries.AddRange(holidays, true);

            return(this);
        }
Exemple #4
0
 public Holidays Fixed(string name, AgnosticDay agnosticDay)
 {
     return(holidays.Fixed(name, agnosticDay));
 }