public void Add (TreeNode child) { child.Index = items.Add (child); child.Tree = tree; child.SetParent (parent); if (marked) { child.TrackViewState (); child.SetDirty (); dirty = true; } }
public void AddAt (int index, TreeNode child) { items.Insert (index, child); child.Index = index; child.Tree = tree; child.SetParent (parent); for (int n=index+1; n<items.Count; n++) ((TreeNode)items[n]).Index = n; if (marked) { child.TrackViewState (); child.SetDirty (); dirty = true; } }