Beispiel #1
0
 private double CheckValue(double value, UI.MultiBarTrack multiBar, DoubleTextBox text)
 {
     if (value > multiBar.MaxEndPointValue)
     {
         value     = multiBar.MaxEndPointValue;
         text.Text = value.ToString();
     }
     else if (value < multiBar.MinEndPointValue)
     {
         value     = multiBar.MinEndPointValue;
         text.Text = value.ToString();
     }
     return(value);
 }
Beispiel #2
0
        private double CheckValue(UI.MultiBarTrack multiBar, DoubleTextBox textBox)
        {
            double value;

            if (double.TryParse(textBox.Text, out value))
            {
                if (value > multiBar.MaxEndPointValue)
                {
                    value        = multiBar.MaxEndPointValue;
                    textBox.Text = value.ToString();
                }
                else if (value < multiBar.MinEndPointValue)
                {
                    value        = multiBar.MinEndPointValue;
                    textBox.Text = value.ToString();
                }
                return(value);
            }
            return(double.NaN);
        }