Example #1
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.EditControl.ValueChanged -= new EventHandler(this.OnValueChanged);
         this.EditControl.Hide();
         this.EditValue = this.EditControl.Date;
     }
     base.Hide();
     this.EditControl = null;
 }
Example #2
0
 protected override void Click(int yOffset, int parentWidth)
 {
     if (this.Enabled)
     {
         if (this.EditControl != null)
         {
             this.EditControl.Focus();
             this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
         }
         else
         {
             base.DisableEvents = true;
             DVTouchDateTimePicker control = base.Parent.GetControl(typeof(DVTouchDateTimePicker)) as DVTouchDateTimePicker;
             if (control != null)
             {
                 control.ForeColor = base.GetTextForeColor();
                 control.BackColor = base.GetTextBackColor();
                 control.Font      = base.TextFont;
                 control.Enabled   = true;
                 control.Style     = this.DateTimeStyle;
                 base.InvokeSetProperty(control.DatePicker, "BackColorVistaStyle", this.BackColorVistaStyle);
                 base.InvokeSetProperty(control.TimePicker, "BackColorVistaStyle", this.BackColorVistaStyle);
                 control.Format    = this.m_Format;
                 control.AllowNone = this.AllowNoneDate;
                 control.NoneText  = this.NoneText;
                 control.TodayText = this.TodayText;
                 base.InvokeSetProperty(control.DatePicker, "ShowDropDown", this.m_showDropDown);
                 base.InvokeSetProperty(control.TimePicker, "ShowDropDown", this.m_showDropDown);
                 base.InvokeSetProperty(control.DatePicker, "MaxDate", this.MaxDate);
                 base.InvokeSetProperty(control.DatePicker, "MinDate", this.MinDate);
                 try
                 {
                     if (this.DateTime == NoneDateTime)
                     {
                         control.Date = System.DateTime.Now;
                         if (this.AllowNoneDate)
                         {
                             control.TimePicker.Enabled = false;
                             base.InvokeSetProperty(control.DatePicker, "IsNone", true);
                             base.InvokeSetProperty(control.TimePicker, "IsNone", true);
                         }
                     }
                     else
                     {
                         control.TimePicker.Enabled = true;
                         control.Date = this.DateTime;
                     }
                 }
                 catch
                 {
                     control.Date = System.DateTime.Now;
                 }
                 this.EditControl      = control;
                 control.ValueChanged += new EventHandler(this.OnValueChanged);
                 control.Bounds        = this.GetActivePartBounds(yOffset);
                 base.DisableEvents    = false;
                 this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
                 base.DisableEvents = true;
                 if (this.EditControl != null)
                 {
                     this.EditControl.Show();
                     if (this.ShowDropDown && this.DropDownClicked(parentWidth, yOffset))
                     {
                         this.DroppedDown = true;
                     }
                 }
             }
             base.DisableEvents = false;
             base.Click(yOffset, parentWidth);
         }
     }
 }