void Handle_Clicked_equal(object sender, System.EventArgs e) { var result = MathEvaluator.Evaluate(Display.Text); Display.Text = result.ToString(); switch (operation) { case "+": Display.Text = (number1 + number2).ToString(); break; case "-": Display.Text = (number1 - number2).ToString(); break; case "*": Display.Text = (number1 * number2).ToString(); break; case "/": Display.Text = (number1 / number2).ToString(); break; } }
public void OnTextChange(object sender, EventArgsVoiceRecognition e) { Display.Text = e.Text; if (Display.Text.Contains("equals")) { speechRecognitionInstnace.Stop(); var result = MathEvaluator.Evaluate(Display.Text); Display.Text = result.ToString(); } }