Пример #1
0
        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;
            }
        }
Пример #2
0
 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();
     }
 }