public ScheduleToken(RuleMonth startMonth, byte startDate, short? startYear, RuleMonth endMonth, byte endDate, short? endYear) : this(ScheduleTokenType.DateRange) { StartMonth = startMonth; StartDate = startDate; StartYear = startYear; EndMonth = endMonth; EndDate = endDate; EndYear = endYear; }
public ScheduleToken(RuleMonth startMonth, RuleMonth endMonth) : this(ScheduleTokenType.MonthRange) { StartMonth = startMonth; EndMonth = endMonth; }
public ScheduleToken(RuleMonth month) : this(ScheduleTokenType.SingleMonth) { Month = month; }
public ScheduleToken(RuleMonth month, byte date, short? year) : this(ScheduleTokenType.SingleDate) { Month = month; Date = date; Year = year; }
private static byte GetPrefixDate(string prefix, RuleMonth month) { switch (prefix[0]) { case 'b': //beginning of return 1; case 'm': // middle return 15; case 'e': // end of return (byte)DateTime.DaysInMonth(DateTime.Now.Year, (int)month); case 't': // the beginning of or the end of if (prefix[4] == 'b') return 1; return (byte)DateTime.DaysInMonth(DateTime.Now.Year, (int)month); } throw new Exception("Unknown month prefix: " + prefix); }