Пример #1
0
        private void HandleOperatorInput(char key)
        {
            if (operation != null && isResultUpdated)
            {
                result = operation.Operate(result, Convert.ToDouble(operand.ToString()));
            }
            else
            {
                result = Convert.ToDouble(operand.ToString());
            }

            operation = operatorFactory.GetOperation(key);

            operand.Clear().Append(result.ToString());
            isOperandConsumed = true;
            isResultUpdated   = true;
        }