Method MoveTo
MoveTo(DomNode, int)
Moves the range into another host: every node is detached from its current parent and re-added at the destination, in order. Moving within the same collection is supported.
public void MoveTo(DomNode target, int index = -1)
Parameters
targetDomNodeThe node whose child collection receives the nodes.
indexintThe insertion index, or -1 to append. It is interpreted after the nodes have been detached.
Exceptions
- ArgumentNullException
targetis null.- ArgumentException
targetholds no editable child collection, cannot hold this range's node type, or is inside the range being moved.- InvalidOperationException
The range no longer describes a contiguous span of its parent's children.