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."); } }
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; }
public TimeFrame(Time From, Time To, bool Exclusion) { this.From = From; this.To = To; this.Exclusion = Exclusion; }