/// <summary> /// Indicates that no amount of undoing/redoing will get the undo queue into a saved state /// (This could occur, for example, if a file were modified outside the application. /// </summary> public void NeverSaved() { bool modified = Modified; m_undoSaved = UndoAction.NeverSaved; if (!modified) { ModifiedChanged.Execute(); } }
/// <summary> /// The associated file has been saved and so any existing items are effectively modifications from the saved state of the file if you undo them /// </summary> public void Saved() { bool modified = Modified; m_undoSaved = m_undoActions.Count != 0 ? m_undoActions.Peek() : null; if (modified) { ModifiedChanged.Execute(); } }
public void Queue(UndoAction action) { bool modified = Modified; m_redoActions.Clear(); m_undoActions.Push(action); Changed.Execute(); Logger.Log(m_name + "changes.txt", "Action: " + action.LogDescription); if (!modified) { ModifiedChanged.Execute(); } }
public Element(UndoQueue queue, UndoAction action) { m_queue = queue; Action = action; }
public void Change(UndoAction actions) { Change(actions.Actions(), actions.Description); }
public static SimpleUndoPair Actions(this UndoAction a) { return(new SimpleUndoPair { Undo = a.Undo, Redo = a.Redo }); }