Exemple #1
0
 public ScheduleToken(byte? hour, byte? minute, HourMeridiem meridiem)
     : this(ScheduleTokenType.SingleHour)
 {
     Hour = hour;
     Minute = minute;
 }
Exemple #2
0
 public ScheduleToken(byte? startHour, byte? startMinute, HourMeridiem startMeridiem, byte? endHour, byte? endMinute, HourMeridiem endMeridiem)
     : this(ScheduleTokenType.HourRange)
 {
     StartHour = startHour;
     StartMinute = startMinute;
     StartMeridiem = startMeridiem;
     EndHour = endHour;
     EndMinute = endMinute;
     EndMeridiem = endMeridiem;
 }
Exemple #3
0
 private static void ParseTime(Match m, string hourGroupName, string minuteGroupName, string meridiemGroupName, string timeGroupName, out byte hour, out byte minute, out HourMeridiem meridiem)
 {
     hour = 0;
     minute = 0;
     meridiem = HourMeridiem.None;
     Group hourGroup = m.Groups[hourGroupName];
     if (hourGroup.Success)
     {
         hour = byte.Parse(hourGroup.Value);
         Group minuteGroup = m.Groups[minuteGroupName];
         if (minuteGroup.Success)
         {
             minute = byte.Parse(minuteGroup.Value);
         }
         Group meridiemGroup = m.Groups[meridiemGroupName];
         if (meridiemGroup.Success)
         {
             meridiem = GetMeridiem(meridiemGroup.Value);
         }
     }
     else
     {
         Group timeGroup = m.Groups[timeGroupName];
         if (timeGroup.Success)
         {
             GetMinute(timeGroup.Value, out hour, out minute);
         }
     }
 }