Esempio n. 1
0
        /// <summary>
        /// Get the depth of item by
        /// getting all its children items' depth, and finding the maximum
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private int GetItemDepth(FlattenTreeItem item)
        {
            int depth         = 0;
            var childrenItems = this._flattenTree.GetChildrenItems(item);

            foreach (var childrenItem in childrenItems)
            {
                int itemDepth = 1 + GetItemDepth(childrenItem);
                if (itemDepth > depth)
                {
                    depth = itemDepth;
                }
            }
            return(depth);
        }
Esempio n. 2
0
 public FlattenTreeItem(int id, FlattenTreeItem parent)
 {
     this.ID          = id;
     this.ParrentItem = parent;
 }