/// <summary> /// Adds the child tree to this node. /// </summary> /// <param name="child">The child tree to add.</param> public void Add(GeneralTree <T> child) { InsertItem(Count, child); }
/// <summary> /// Removes the item from the tree. /// </summary> /// <param name="index">The index.</param> /// <param name="item">The item to remove.</param> /// <remarks> /// <b>Notes to Inheritors: </b> /// Derived classes can override this method to change the behavior of the <see cref="RemoveAt"/> method. /// </remarks> protected virtual void RemoveItem(int index, GeneralTree <T> item) { item.parent = null; childNodes.RemoveAt(index); }
/// <inheritdoc /> void ICollection <T> .Add(T item) { var child = new GeneralTree <T>(item); InsertItem(Count, child); }