Exemple #1
0
        public void Add(char mathOperator, int value)
        {
            Commander command = new CalculatorCommand(_calculator, mathOperator, value);

            command.Run();

            _commands.Add(command);
            _total++;
        }
Exemple #2
0
        public void Compute(char operatorKey, int operand)
        {
            //Create commmand and execute
            Command command = new CalculatorCommand(_calculator, operatorKey, operand);

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