예제 #1
0
        private void ManipulateValue(TextBox tb, ValueManipulator ValMan)
        {
            if (tb.get_HMSType() == HMSType.t || tb.get_HMSType() == HMSType.tt)
            {
                AM_PM_Change(tb);
                return;
            }
            int NewValue;

            if (int.TryParse(tb.Text, out NewValue))
                ValMan(tb, NewValue);

            tb.Focus();
            tb.SelectAll();
        }
예제 #2
0
 private void DecrementValue(TextBox tb, int NewValue)
 {
     NewValue = (NewValue > tb.get_Min()) ? NewValue - 1 : tb.get_Max() - 1;
     NewValue = AdjustHalfDayHour(tb, NewValue);
     Value = Value.ResetTime(NewValue, tb.get_HMSType());
 }
예제 #3
0
 void AM_PM_Change(TextBox tb)
 {
     if (tb.get_HMSType() == HMSType.tt)
         tb.Text = (tb.Text == SystemDateInfo.AMDesignator) ? SystemDateInfo.PMDesignator : SystemDateInfo.AMDesignator;
     else // tb.get_HMSType() == HMSType.t
     {
         int Idx = TimeCtrlExtensions.Get_t_Idx();
         tb.Text = (tb.Text == SystemDateInfo.AMDesignator[Idx].ToString()) ?
             SystemDateInfo.PMDesignator[Idx].ToString() : SystemDateInfo.AMDesignator[Idx].ToString();
     }
     AM_PM_Handle(tb);
 }
예제 #4
0
 bool AM_PM_HandleInput(TextBox tb, string InputTxt, string AM_PM_Designator, int Idx)
 {
     if (string.Compare(InputTxt, AM_PM_Designator[Idx].ToString(), true) == 0)
     {
         if (tb.get_HMSType() == HMSType.tt)
             tb.Text = AM_PM_Designator;  
         else // tb.get_HMSType() == HMSType.t
             tb.Text = AM_PM_Designator[Idx].ToString(); 
  
         AM_PM_Handle(tb);
         return true;
     }
     return false;
 }
예제 #5
0
        void AM_PM_Handle(TextBox tb)
        {
            bool IsAm;
            if (tb.get_HMSType() == HMSType.tt)
                IsAm = (tb.Text == SystemDateInfo.AMDesignator);
            else // tb.get_HMSType() == HMSType.t
                IsAm = (tb.Text == SystemDateInfo.AMDesignator[TimeCtrlExtensions.Get_t_Idx()].ToString());

            Value = Value.Reset_AM_PM_Time(IsAm);

            tb.SelectAll();
        }