/// <summary> /// Appends the child. /// </summary> /// <param name="child">The child.</param> /// <returns></returns> public ASTreeViewNode AppendChild(ASTreeViewNode child) { child.SetParent(this); this.childNodes.Add(child); return(this); }
/// <summary> /// Removes the specified node. /// </summary> /// <param name="node">The node.</param> /// <returns></returns> public ASTreeViewNode Remove(ASTreeViewNode node) { if (this.childNodes.Contains(node)) { this.childNodes.Remove(node); node.SetParent(null); } return(this); }
/// <summary> /// Inserts the specified index. /// </summary> /// <param name="index">The index.</param> /// <param name="node">The node.</param> /// <returns></returns> public ASTreeViewNode Insert(int index, ASTreeViewNode node) { if (index > this.childNodes.Count) { this.AppendChild(node); } else { this.childNodes.Insert(index, node); } node.SetParent(this); return(this); }