예제 #1
0
        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);
        }
예제 #2
0
파일: Calendar.cs 프로젝트: mpvyard/qwack
 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);
 }