Пример #1
0
        /// <summary>
        /// 获得父级项
        /// </summary>
        /// <param name="addself"></param>
        /// <returns></returns>
        public List <SLTreeView2Data> GetTreeViewDataParents(bool addself = false)
        {
            List <SLTreeView2Data> list = new List <SLTreeView2Data>();

            if (ParentItem != null)
            {
                list.AddRange(ParentItem.GetTreeViewDataParents());
                list.Add(ParentItem);
            }
            if (addself)
            {
                list.Add(this);
            }
            return(list);
        }