示例#1
0
 /// <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);
 }
示例#2
0
 /// <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);
 }
示例#3
0
        /// <inheritdoc />
        void ICollection <T> .Add(T item)
        {
            var child = new GeneralTree <T>(item);

            InsertItem(Count, child);
        }