/// <summary> /// /// </summary> public void Redo() { if (CanRedo) { m_IsProcessing = true; try { IUndoCommand command = m_Redo.Pop(); LogManager.Instance.WriteLine(LogVerbosity.Trace, "UndoRedo Redo({0}) : history list: {1} item(s)", command.ToString(), m_Undo.Count); command.Redo(); m_Undo.Push(command); OnPropertyChanged("CanUndo"); OnPropertyChanged("CanRedo"); if (UndoRedoCommandExecuted != null) { UndoRedoCommandExecuted(null, EventArgs.Empty); } } catch (System.Exception ex) { throw ex; } finally { m_IsProcessing = false; } } }
/// <summary> /// /// </summary> /// <param name="command_"></param> /// <param name="arg_"></param> public void Add(IUndoCommand command_) { if (m_IsProcessing == true) { LogManager.Instance.WriteLine(LogVerbosity.Trace, "UndoRedo : can't add because processing"); return; } m_Undo.Push(command_); m_Redo.Clear(); LogManager.Instance.WriteLine(LogVerbosity.Trace, "UndoRedo Add({0}) : history list: {1} item(s)", command_.ToString(), m_Undo.Count); OnPropertyChanged("CanUndo"); OnPropertyChanged("CanRedo"); if (UndoRedoCommandListChanged != null) { UndoRedoCommandListChanged(null, EventArgs.Empty); } }