private void EquationFieldsClickEventListener(object sender, RoutedEventArgs e) { if (CheckEquationFieldsForErrorsReturnIfFound()) { return; } Reaction = new EquationClass(equationTextBox.Text, isBalancedCheckBox.IsChecked.Value); Reaction.speciesArray = Reaction.MakeAndReturnSpeciesArray(); UpdateUIAfterSubmittedEquationFields(); }
private bool CheckEquationFieldsForErrorsReturnIfFound() { if (!isBalancedCheckBox.IsChecked.Value) { MessageBox.Show("Unfortunately I don't have the\nability to balance equations yet.\nPlease enter a balanced equation."); return(true); } if (!EquationClass.EquationInputRegExCheck(equationTextBox.Text)) //Check regular expression of inputted equation { MessageBox.Show("It looks like you entered the equation in the wrong format.\nIt must be like: X + Y = Z"); return(true); } return(false); }