Skip to content

Add New Nodes

David West edited this page Aug 26, 2016 · 1 revision

< Mutable Trees

Add Node As Child of Current

public virtual TNode AddChild(TItem item, int? insertIndex = null)

The second, optional parameter allows the new node to be inserted at a particular child order index. If it is specified and greater than the current number of children, the node is added as the last child.

Add Node As Adjacent Sibling of Current

public virtual TNode AddAtAdjacentPosition(TItem item, Adjacency adjacency)

Adjacency is an enum with two possible values:

  • Before
  • After

The following shortcut methods exist:

public TNode AddAtPositionBefore(TItem item)
public TNode AddAtPositionAfter(TItem item)

Move Nodes >

Clone this wiki locally