Пример #1
0
        public int Compute(char @operator, int operand, bool test)
        {
            // Create command operation and execute it
            Command command = new CalculatorCommand(_calculator, @operator, operand);
            var     result  = command.Execute(true);

            // Add command to undo list
            _commands.Add(command);
            _current++;
            return(result);
        }
Пример #2
0
        public void Compute(char @operator, int operand)
        {
            // Create command operation and execute it
            Command command = new CalculatorCommand(_calculator, @operator, operand);

            command.Execute();

            // Add command to undo list
            _commands.Add(command);
            _current++;
        }