Example #1
0
        /// <inheritdoc />
        /// <summary>
        /// Pushes an action to the <see cref="P:ModernApplicationFramework.Basics.UndoRedoManager.UndoRedoManager.UndoStack" /> and
        /// clears the <see cref="P:ModernApplicationFramework.Basics.UndoRedoManager.UndoRedoManager.RedoStack" /> if this method was executed outside of the manager
        /// </summary>
        /// <param name="action">The action that was performed and pushed to the <see cref="P:ModernApplicationFramework.Basics.UndoRedoManager.UndoRedoManager.UndoStack" /></param>
        public void Push(UndoRedoAction action)
        {
            Push(_undoStack, action);

            if (!_isChanging)
            {
                _redoStack.Clear();
            }
        }
Example #2
0
 private static void Push(ICollection <UndoRedoAction> stack, UndoRedoAction action)
 {
     stack.Add(action);
 }