Ejemplo n.º 1
0
        /// <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();
            }
        }
Ejemplo n.º 2
0
        /// <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();
            }
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
 public Element(UndoQueue queue, UndoAction action)
 {
     m_queue = queue;
     Action  = action;
 }
Ejemplo n.º 5
0
 public void Change(UndoAction actions)
 {
     Change(actions.Actions(), actions.Description);
 }
Ejemplo n.º 6
0
 public static SimpleUndoPair Actions(this UndoAction a)
 {
     return(new SimpleUndoPair {
         Undo = a.Undo, Redo = a.Redo
     });
 }