private Holiday FixedHoliday(string descrizione, AgnosticDay agnosticDay, int currentYear) { var dateTime = new DateTime(currentYear, agnosticDay.Month, agnosticDay.Day); return (Holiday.Fixed(descrizione, dateTime)); }
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(); } }
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); }
public Holidays Fixed(string name, AgnosticDay agnosticDay) { return(holidays.Fixed(name, agnosticDay)); }