public DateRangePropertyEditorControl(DateRange range) { InitializeComponent(); this.dpStart.SelectedDate = range.BeginValue; this.dpEnd.SelectedDate = range.EndValue; if (range == null) throw new ArgumentNullException("range"); this._range = range; }
public static DateRange Parse(string value) { var result = new DateRange(); if (string.IsNullOrEmpty(value) == false) { var values = value.Split(new string[] { SPLIT_STRING }, StringSplitOptions.RemoveEmptyEntries); if (values.Length > 1) { result._beginValue = Convert.ToDateTime(values[0]); result._endValue = Convert.ToDateTime(values[1]); } else if (values.Length == 1) { result._endValue = Convert.ToDateTime(values[0]); } } return result; }
/// <summary> /// 克隆一个对象 /// </summary> /// <param name="a"></param> public DateRange(DateRange a) { this._beginValue = a._beginValue; this._endValue = a._endValue; }
public DateRangeClickEventArgs(DateRange range) { this._range = range; }