Esempio n. 1
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         DateTimePickerInterface.SetDroppedDown(this.EditControl, false);
         this.EditControl.Hide();
         DateTimePickerInterface.RemoveValueChangedEvent(this.EditControl, new EventHandler(this.OnValueChanged));
         DateTimePickerInterface.RemoveNoneSelectedEvent(this.EditControl, new EventHandler(this.OnValueChanged));
     }
     base.Hide();
     this.EditControl = null;
 }
Esempio n. 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;
             Resco.Controls.DetailView.DetailView parent  = base.Parent;
             System.Windows.Forms.Control         control = base.Parent.GetControl(this.GetDateTimePickerType());
             if (control != null)
             {
                 control.ForeColor = base.GetTextForeColor();
                 control.BackColor = base.GetTextBackColor();
                 control.Font      = base.TextFont;
                 control.Enabled   = true;
                 DateTimePickerInterface.SetFormat(control, Resco.Controls.DetailView.DateTimePickerFormat.CustomTime);
                 DateTimePickerInterface.SetCustomFormat(control, this.m_Format);
                 DateTimePickerInterface.SetShowNone(control, this.AllowNoneTime);
                 DateTimePickerInterface.SetShowUpDown(control, this.ShowTimeUpDown);
                 DateTimePickerInterface.SetShowDropDown(control, this.ShowDropDown);
                 DateTimePickerInterface.SetShowTimeNone(control, this.ShowTimeNone);
                 DateTimePickerInterface.SetNoneText(control, this.NoneText);
                 DateTimePickerInterface.SetTimePickerStartTime(control, new DateTime(1, 1, 1, this.m_startTime.Hours, this.m_startTime.Minutes, this.m_startTime.Seconds));
                 DateTimePickerInterface.SetTimePickerEndTime(control, new DateTime(1, 1, 1, this.m_endTime.Hours, this.m_endTime.Minutes, this.m_endTime.Seconds));
                 DateTimePickerInterface.SetTimePickerMinuteInterval(control, this.m_minuteInterval);
                 DateTimePickerInterface.SetChecked(control, true);
                 try
                 {
                     if (this.EditValue == null)
                     {
                         DateTimePickerInterface.SetValue(control, DateTime.Now);
                         if (this.AllowNoneTime)
                         {
                             DateTimePickerInterface.SetChecked(control, false);
                         }
                     }
                     else
                     {
                         DateTimePickerInterface.SetValue(control, DateTime.Today.AddTicks(this.TimeSpan.Ticks));
                     }
                 }
                 catch
                 {
                     DateTimePickerInterface.SetValue(control, DateTime.Now);
                 }
                 this.EditControl = control;
                 DateTimePickerInterface.AddValueChangedEvent(control, new EventHandler(this.OnValueChanged));
                 DateTimePickerInterface.AddNoneSelectedEvent(control, 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();
                     this.EditControl.Focus();
                     if (this.DropDownClicked(parentWidth, yOffset))
                     {
                         DateTimePickerInterface.SetDroppedDown(this.EditControl, true);
                     }
                 }
             }
             base.DisableEvents = false;
             base.Click(yOffset, parentWidth);
         }
     }
 }