Ejemplo n.º 1
0
        public void Compute(char @operator, int operand)
        {
            Command command = new CalculatorCommand(this.calculator, @operator, operand);
            command.Execute();

            this.commands.Add(command);
            this.current++;
        }
Ejemplo n.º 2
0
        public void Compute(char @operator, int operand)
        {
            Command command = new CalculatorCommand(this.calculator, @operator, operand);

            command.Execute();

            this.commands.Add(command);
            this.current++;
        }
Ejemplo n.º 3
0
        public void Compute(char _operator, int operand)
        {
            Command cmnd = new CalculatorCommand(_operator, operand, calculator);

            cmnd.Execute();

            //Add command to undo list
            _commands.Add(cmnd);
            _current++;
        }
Ejemplo n.º 4
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);
            currentCommand++;
        }
Ejemplo n.º 5
0
        public void Compute(char @operator, int operand)
        {
            // 创建命令并执行之
            Command command = new CalculatorCommand(
                calculator, @operator, operand);

            command.Execute();

            // 将命令添加至ArrayList保存
            commands.Add(command);
            current++;
        }
Ejemplo n.º 6
0
        public void Compute(Operation operation, int operand)
        {
            Command command = new CalculatorCommand(_calculator, operation, operand);

            command.Execute();

            if (_current < _commands.Count)
            {
                _commands.RemoveRange(_current, _commands.Count - _current);
            }
            _commands.Add(command);
            _current++;
        }
Ejemplo n.º 7
0
        public void Compute(char @operator, int operand)
        {
            // Create command operation and execute it
            Command command = new CalculatorCommand(
                this.calculator, @operator, operand);

            command.Execute();

            // Add command to undo list

            this.commands.Add(command);

            this.current++;
        }