예제 #1
0
        //------------------------------------------------------
        //
        //  Public Methods
        //
        //------------------------------------------------------

        #region Public Methods

        // Called by the undo manager.  Restores tree state to its condition
        // when the unit was created.  Assumes the tree state matches conditions
        // just after the unit was created.
        public override void DoCore()
        {
            TextPointer start;
            TextPointer end;
            TextElement element;

            VerifyTreeContentHashCode();

            start = new TextPointer(this.TextContainer, this.SymbolOffset, LogicalDirection.Forward);
            end   = new TextPointer(this.TextContainer, this.SymbolOffset + _symbolCount - 2, LogicalDirection.Forward);

            // Insert a new element.
            element = (TextElement)Activator.CreateInstance(_type);
            element.Reposition(start, end);

            // Restore local resources
            element.Resources = _resources;

            // Move end into the scope of the new element.
            end.MoveToNextContextPosition(LogicalDirection.Backward);
            // Then restore local property values.
            // Shouldn't we call this with deferLoad=true and call EndDeferLoad after all parameters set?
            this.TextContainer.SetValues(end, ArrayToLocalValueEnumerator(_localValues));

            if (element is Table)
            {
                TextTreeDeleteContentUndoUnit.RestoreColumns((Table)element, _columns);
            }
        }
 // Token: 0x0600860B RID: 34315 RVA: 0x0024B8B8 File Offset: 0x00249AB8
 internal override void Do(TextPointer navigator)
 {
     base.Do(navigator);
     if (this._columns != null)
     {
         TextPointer textPointer = new TextPointer(navigator.TextContainer.Start, this._cpTable, LogicalDirection.Forward);
         Table       table       = (Table)textPointer.Parent;
         TextTreeDeleteContentUndoUnit.RestoreColumns(table, this._columns);
     }
 }
예제 #3
0
        // Token: 0x06003D17 RID: 15639 RVA: 0x0011BC9C File Offset: 0x00119E9C
        public override void DoCore()
        {
            base.VerifyTreeContentHashCode();
            TextPointer start       = new TextPointer(base.TextContainer, base.SymbolOffset, LogicalDirection.Forward);
            TextPointer textPointer = new TextPointer(base.TextContainer, base.SymbolOffset + this._symbolCount - 2, LogicalDirection.Forward);
            TextElement textElement = (TextElement)Activator.CreateInstance(this._type);

            textElement.Reposition(start, textPointer);
            textElement.Resources = this._resources;
            textPointer.MoveToNextContextPosition(LogicalDirection.Backward);
            base.TextContainer.SetValues(textPointer, TextTreeUndoUnit.ArrayToLocalValueEnumerator(this._localValues));
            if (textElement is Table)
            {
                TextTreeDeleteContentUndoUnit.RestoreColumns((Table)textElement, this._columns);
            }
        }