// Inserts the content held by this container at a specified position.
            // Navigator is positioned just past the new content on return.
            // Navigator is expected to have forward gravity.
            internal override void Do(TextPointer navigator)
            {
                ContentContainer container;
                TextElement      element;

                // Insert the element.
                element = (TextElement)Activator.CreateInstance(_elementType);
                element.Reposition(navigator, navigator);

                // Get inside its scope.
                navigator.MoveToNextContextPosition(LogicalDirection.Backward);

                // Set local values.
                // Shouldn't we call this with deferLoad=true and call EndDeferLoad after all parameters set?
                navigator.TextContainer.SetValues(navigator, TextTreeUndoUnit.ArrayToLocalValueEnumerator(_localValues));

                // Restore resources
                element.Resources = _resources;

                // Insert contained content.
                for (container = _childContainer; container != null; container = container.NextContainer)
                {
                    container.Do(navigator);
                }

                // Move outside the element's scope again.
                navigator.MoveToNextContextPosition(LogicalDirection.Forward);
            }
Example #2
0
 // Token: 0x06003D16 RID: 15638 RVA: 0x0011BC18 File Offset: 0x00119E18
 internal TextTreeExtractElementUndoUnit(TextContainer tree, TextTreeTextElementNode elementNode) : base(tree, elementNode.GetSymbolOffset(tree.Generation))
 {
     this._symbolCount = elementNode.SymbolCount;
     this._type        = elementNode.TextElement.GetType();
     this._localValues = TextTreeUndoUnit.GetPropertyRecordArray(elementNode.TextElement);
     this._resources   = elementNode.TextElement.Resources;
     if (elementNode.TextElement is Table)
     {
         this._columns = TextTreeDeleteContentUndoUnit.SaveColumns((Table)elementNode.TextElement);
     }
 }
            // Token: 0x06008609 RID: 34313 RVA: 0x0024B804 File Offset: 0x00249A04
            internal override void Do(TextPointer navigator)
            {
                TextElement textElement = (TextElement)Activator.CreateInstance(this._elementType);

                textElement.Reposition(navigator, navigator);
                navigator.MoveToNextContextPosition(LogicalDirection.Backward);
                navigator.TextContainer.SetValues(navigator, TextTreeUndoUnit.ArrayToLocalValueEnumerator(this._localValues));
                textElement.Resources = this._resources;
                for (TextTreeDeleteContentUndoUnit.ContentContainer contentContainer = this._childContainer; contentContainer != null; contentContainer = contentContainer.NextContainer)
                {
                    contentContainer.Do(navigator);
                }
                navigator.MoveToNextContextPosition(LogicalDirection.Forward);
            }
Example #4
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);
            }
        }
 // Token: 0x06003D15 RID: 15637 RVA: 0x0011BB88 File Offset: 0x00119D88
 private TextTreeNode CopyElementNode(TextTreeTextElementNode elementNode, out TextTreeDeleteContentUndoUnit.ContentContainer container)
 {
     if (elementNode.TextElement is Table)
     {
         container = new TextTreeDeleteContentUndoUnit.TableElementContentContainer(elementNode.TextElement as Table, TextTreeUndoUnit.GetPropertyRecordArray(elementNode.TextElement), this.CopyContent((TextTreeNode)elementNode.GetFirstContainedNode(), null));
     }
     else
     {
         container = new TextTreeDeleteContentUndoUnit.ElementContentContainer(elementNode.TextElement.GetType(), TextTreeUndoUnit.GetPropertyRecordArray(elementNode.TextElement), elementNode.TextElement.Resources, this.CopyContent((TextTreeNode)elementNode.GetFirstContainedNode(), null));
     }
     return((TextTreeNode)elementNode.GetNextNode());
 }