示例#1
0
 public static Time Parse(string Time)
 {
     try
     {
         string[] N = Time.Split(new string[] { ":" }, StringSplitOptions.None);
         Time T = new Time(int.Parse(N[0]), int.Parse(N[1]));
         return T;
     }
     catch { throw new FormatException("The time format is invalid."); }
 }
示例#2
0
 public void SetFields(bool Edit, bool Disallow, Time Start, Time End)
 {
     this.Text = Edit ? "Edit rule" : "Add rule";
     this.Save.Text = Edit ? "Save changes" : "Add rule";
     this.Disallow.Checked = Disallow;
     this.FirstHour.Value = Start.Hour;
     this.FirstMinute.Value = Start.Minute;
     this.SecondHour.Value = End.Hour;
     this.SecondMinute.Value = End.Minute;
 }
示例#3
0
 public TimeFrame(Time From, Time To, bool Exclusion)
 {
     this.From = From;
     this.To = To;
     this.Exclusion = Exclusion;
 }