Exemple #1
0
        /// <summary>
        /// 将一个数据加入树的子结点
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public JTree <T> Add(T node)
        {
            JTree <T> child = new JTree <T>(node);

            mChildren.Add(child);
            child.Parent = this;
            return(child);
        }
Exemple #2
0
 /// <summary>
 /// 删除树的第一级子树
 /// </summary>
 /// <param name="child">第一级子树</param>
 /// <returns>被删除的子树</returns>
 public JTree <T> Remove(JTree <T> child)
 {
     return(mChildren.Remove(child) ? child : null);
 }