public void Compute(char @operator, int operand) { Command command = new CalculatorCommand(this.calculator, @operator, operand); command.Execute(); this.commands.Add(command); this.current++; }
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++; }
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++; }
public void Compute(char @operator, int operand) { // 创建命令并执行之 Command command = new CalculatorCommand( calculator, @operator, operand); command.Execute(); // 将命令添加至ArrayList保存 commands.Add(command); current++; }
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++; }
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++; }