public void insertChild(Node child, int position) { if (position == 0) { this.m_XContainer.AddFirst(child.XNode); } else { var elementAtPosition = this.m_XContainer.Nodes().ElementAt(position - 1); elementAtPosition.AddAfterSelf(child.XNode); } }
public void appendChild(Node child) { var childAsParentNode = child as ParentNode; if (childAsParentNode != null) { this.m_XContainer.Add(childAsParentNode.m_XContainer); } var childAsText = child as Text; if (childAsText != null) { this.m_XContainer.Add(childAsText.XText); } }
public void removeChild(Node child) { child.detach(); }
public int indexOf(Node node) { return this.m_XContainer.Nodes().ToList().IndexOf(node.XNode); }