public FormatNode SplitNodeBeforeChild(FormatNode child) { FormatStore.NodeEntry[] array = this.nodes.Plane(this.nodeHandle); int num = this.nodes.Index(this.nodeHandle); int handle = this.nodes.Allocate(this.NodeType, array[num].BeginTextPosition); FormatStore.NodeEntry[] array2 = this.nodes.Plane(handle); int num2 = this.nodes.Index(handle); array2[num2].NodeFlags = array[num].NodeFlags; array2[num2].TextMapping = array[num].TextMapping; array2[num2].EndTextPosition = child.BeginTextPosition; array2[num2].FlagProperties = array[num].FlagProperties; array2[num2].PropertyMask = array[num].PropertyMask; array2[num2].Properties = array[num].Properties; array[num].BeginTextPosition = child.BeginTextPosition; FormatNode formatNode = new FormatNode(this.nodes, handle); do { FormatNode firstChild = this.FirstChild; firstChild.RemoveFromParent(); formatNode.AppendChild(firstChild); }while (this.FirstChild != child); this.InsertSiblingBefore(formatNode); return(formatNode); }
public void MoveAllChildrenToNewParent(FormatNode newParent) { while (!this.FirstChild.IsNull) { FormatNode firstChild = this.FirstChild; firstChild.RemoveFromParent(); newParent.AppendChild(firstChild); } }