const int MaxDayInMonthFixAttempts = 12 * 10; //12 months * 10 ; means we check if the date can be found up to 10 years in the future. #endregion Fields #region Constructors internal CronSchedule(SecondField secondField, MinuteField minuteField, HourField hourField, DayOfMonthField dayOfMonthField, MonthField monthField, DayOfWeekField dayOfWeek) { SecondField = secondField; MinuteField = minuteField; HourField = hourField; DayOfMonthField = dayOfMonthField; MonthField = monthField; DayOfWeek = dayOfWeek; }
private static CronSchedule BuildCronSchedule(string[] fieldExpressions) { var secondField = new SecondField(fieldExpressions[SecondIndex]); var minuteField = new MinuteField(fieldExpressions[MinuteIndex]); var hourField = new HourField(fieldExpressions[HourIndex]); var dayOfMonthField = new DayOfMonthField(fieldExpressions[DayOfMonthIndex]); var monthField = new MonthField(fieldExpressions[MonthIndex]); var dayOfWeek = new DayOfWeekField(fieldExpressions[DayOfWeekIndex]); return new CronSchedule(secondField, minuteField, hourField, dayOfMonthField, monthField, dayOfWeek); }