/// <inheritdoc/> public void Transact(IReversableCommand command, object parameter) { RedoStack.Clear(); Action undo = command.Execute(parameter); Action redo() => command.Execute(parameter); UndoStack.Push(new UndoRedo(undo, redo)); Transacted?.Invoke(); }
private Action Undo(object parameter) => () => { if (!_hasBeenUndone) { _command.Execute(parameter); _hasBeenUndone = true; } };
/// <inheritdoc/> public Action Execute(object parameter) { _command.Execute(parameter); return(() => _undoCommand.Execute(parameter)); }
/// <inheritdoc/> public void Transact(IReversableCommand command, object parameter) { command.Execute(parameter); Transacted?.Invoke(); }