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); }
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); }