Esempio n. 1
0
        private object GetDate()
        {
            if (this.AllowNone && ((bool)DateTimePickerInterface.InvokeGetProperty(this.m_DateTime, "IsNone")))
            {
                return(null);
            }
            DateTime time = (DateTime)DateTimePickerInterface.InvokeGetProperty(this.m_DateTime, "Value");

            if (this.Style == RescoDateTimePickerStyle.Date)
            {
                return(time);
            }
            DateTime time2 = (DateTime)DateTimePickerInterface.InvokeGetProperty(this.m_TimeCombo, "Value");

            return(new DateTime(time.Year, time.Month, time.Day, time2.Hour, time2.Minute, time2.Second, time2.Millisecond));
        }
Esempio n. 2
0
 protected virtual void OnValueChanged(object sender, EventArgs e)
 {
     if (!this.DisableEvents)
     {
         if ((this.GetDate() == null) && (this.Style != RescoDateTimePickerStyle.Time))
         {
             this.m_TimeCombo.Enabled = false;
         }
         else
         {
             this.m_TimeCombo.Enabled = true;
         }
         if (this.AllowNone)
         {
             DateTimePickerInterface.InvokeSetProperty(this.m_TimeCombo, "IsNone", DateTimePickerInterface.InvokeGetProperty(this.m_DateTime, "IsNone"));
         }
         else
         {
             DateTimePickerInterface.InvokeSetProperty(this.m_DateTime, "IsNone", false);
             DateTimePickerInterface.InvokeSetProperty(this.m_TimeCombo, "IsNone", false);
         }
         this.m_TimeCombo.Invalidate();
         if (this.ValueChanged != null)
         {
             this.ValueChanged(this, EventArgs.Empty);
         }
     }
 }