public void AddCommand(SwagCommand cmd) { if (!_isFrozen) { _commandHistory.Add(_commandHistory.Count, cmd); } }
public void Redo() { if (_undoHistory.Count > 0) { using (var scope = GetFrozenScope()) { SwagCommand cmd = _undoHistory.Get(_undoHistory.Count - 1); _commandHistory.Add(_commandHistory.Count, cmd); _undoHistory.Remove(_undoHistory.Count - 1); cmd.Execute(); } } }