Example #1
0
 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;
 }
Example #2
0
 public ScheduleToken(RuleMonth startMonth, RuleMonth endMonth)
     : this(ScheduleTokenType.MonthRange)
 {
     StartMonth = startMonth;
     EndMonth = endMonth;
 }
Example #3
0
 public ScheduleToken(RuleMonth month)
     : this(ScheduleTokenType.SingleMonth)
 {
     Month = month;
 }
Example #4
0
 public ScheduleToken(RuleMonth month, byte date, short? year)
     : this(ScheduleTokenType.SingleDate)
 {
     Month = month;
     Date = date;
     Year = year;
 }
Example #5
0
 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);
 }