Esempio n. 1
0
        // CreateImmediateEditingScope - creates a new ImmediateEditingScope which gatters all edits in its  
        // undo unit list. all changes in ImmediateEditingScope appear as a one change and can be 
        // undoned or redoned as a one set.
        internal ImmediateEditingScope CreateImmediateEditingScope(string bookmarkName, ModelTreeManager modelTreeManager)
        {
            Fx.Assert(modelTreeManager != null, "modelTreeManager should not be null.");

            //only one bookmark is supported
            Fx.Assert(this.bookmark == null, "Nested bookmarks are not supported.");

            //create bookmark undo unit, and give it a description
            BookmarkUndoUnit unit = new BookmarkUndoUnit(this.context, modelTreeManager)
            {
                Description = bookmarkName ?? string.Empty,
            };
            //create bookmark, and pass bookmark undo unit to it.
            this.bookmark = new Bookmark(this, unit);
            //switch implementation of AddUndoUnit, Undo, Redo to be delegated through bookmark
            this.undoEngineImpl = bookmark;
            return new ImmediateEditingScope(modelTreeManager, this.bookmark);
        }
        // CreateImmediateEditingScope - creates a new ImmediateEditingScope which gatters all edits in its
        // undo unit list. all changes in ImmediateEditingScope appear as a one change and can be
        // undoned or redoned as a one set.
        internal ImmediateEditingScope CreateImmediateEditingScope(string bookmarkName, ModelTreeManager modelTreeManager)
        {
            Fx.Assert(modelTreeManager != null, "modelTreeManager should not be null.");

            //only one bookmark is supported
            Fx.Assert(this.bookmark == null, "Nested bookmarks are not supported.");

            //create bookmark undo unit, and give it a description
            BookmarkUndoUnit unit = new BookmarkUndoUnit(this.context, modelTreeManager)
            {
                Description = bookmarkName ?? string.Empty,
            };

            //create bookmark, and pass bookmark undo unit to it.
            this.bookmark = new Bookmark(this, unit);
            //switch implementation of AddUndoUnit, Undo, Redo to be delegated through bookmark
            this.undoEngineImpl = bookmark;
            return(new ImmediateEditingScope(modelTreeManager, this.bookmark));
        }
Esempio n. 3
0
 internal Bookmark(UndoEngine undoEngine, BookmarkUndoUnit undoUnit)
 {
     this.undoEngine = undoEngine;
     this.containerUndoUnit = undoUnit;
 }
 internal Bookmark(UndoEngine undoEngine, BookmarkUndoUnit undoUnit)
 {
     this.undoEngine        = undoEngine;
     this.containerUndoUnit = undoUnit;
 }