示例#1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            try
            {
                double firstNumber = Convert.ToDouble(textBox1.Text);


                IOoneCalculator calculator  = OneArgumentFactory.CreateCalculator(((Button)sender).Name);
                double          answerDigit = calculator.Calculate(firstNumber);

                textBox3.Text = answerDigit.ToString();
            }
            catch (Exception exc)
            {
                textBox3.Text = exc.Message;
            }
        }