Exemplo n.º 1
0
        private void Calculate_Two(object sender, EventArgs e)
        {
            try
            {
                double firstOperand = Convert.ToDouble(Input1.Text);
                IOneArgumentsCalculator calculator = OneArgumentCalculatorsFactory.CreateCalculator(((Button)sender).Name);
                double result = calculator.CalculateTwo(firstOperand);

                Result.Text = result.ToString(CultureInfo.InvariantCulture);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }