public bool IsHoliday(DateTime date) { if (CalendarType != CalendarType.Regular) { return(IsHolidayFromRules(date)); } if (MonthsToExclude.Contains((MonthEnum)date.Month)) { return(true); } if (DaysToAlwaysExclude.Contains(date.DayOfWeek)) { return(true); } else if (DaysToExclude.Contains(date.Date)) { return(true); } foreach (var ic in InheritedCalendarObjects) { if (ic.IsHoliday(date)) { return(true); } } return(false); }
public bool IsHoliday(DateTime date) { if (MonthsToExclude.Contains((MonthEnum)date.Month)) { return(true); } if (DaysToAlwaysExclude.Contains(date.DayOfWeek)) { return(true); } else if (DaysToExclude.Contains(date.Date)) { return(true); } return(false); }