예제 #1
0
파일: Holidays.cs 프로젝트: Eye-Soft/HSDK
        private Holiday FixedHoliday(string descrizione, AgnosticDay agnosticDay, int currentYear)
        {
            var dateTime = new DateTime(currentYear, agnosticDay.Month, agnosticDay.Day);

            return
                (Holiday.Fixed(descrizione, dateTime));
        }
예제 #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();
            }
        }
예제 #3
0
파일: Holidays.cs 프로젝트: Eye-Soft/HSDK
        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);
        }
예제 #4
0
 public Holidays Fixed(string name, AgnosticDay agnosticDay)
 {
     return(holidays.Fixed(name, agnosticDay));
 }