Пример #1
0
        void MethodCallTwoOperand(string operation, TextBox res)
        {
            switch (operation)
            {
            case "plus":
                res.Text = calculator.Plus(Convert.ToDouble(textBox_first_arg.Text),
                                           Convert.ToDouble(textBox_lastarg_or_answer.Text)).ToString(); break;

            case "difference":
                res.Text = calculator.Difference(Convert.ToDouble(textBox_first_arg.Text),
                                                 Convert.ToDouble(textBox_lastarg_or_answer.Text)).ToString(); break;

            case "multiply":
                res.Text = calculator.Multiply(Convert.ToDouble(textBox_first_arg.Text),
                                               Convert.ToDouble(textBox_lastarg_or_answer.Text)).ToString(); break;

            case "divizion":
                res.Text = calculator.Divizion(Convert.ToDouble(textBox_first_arg.Text),
                                               Convert.ToDouble(textBox_lastarg_or_answer.Text)).ToString(); break;

            case "exponentiation": res.Text = calculator.Exponentiation(Convert.ToDouble(textBox_first_arg.Text),
                                                                        Convert.ToDouble(textBox_lastarg_or_answer.Text)).ToString(); break;

            default:
                break;
            }
        }