Beispiel #1
0
        public static List <FolderInfo> GetRelationList(List <FolderInfo> list, int intParentID)
        {
            List <FolderInfo> list2 = list.FindAll((FolderInfo parameterA) => parameterA.ParentID == intParentID);
            List <FolderInfo> list3 = new List <FolderInfo>();
            int num = 0;

            foreach (FolderInfo current in list2)
            {
                if (num == list2.Count - 1)
                {
                    current.FolderName = ((current.ParentID == 0) ? "" : StringUtils.GetCatePrefix(current.Depth - 1, true)) + StringUtils.GetChineseSpell(current.FolderName).Substring(0, 1) + current.FolderName;
                }
                else
                {
                    current.FolderName = ((current.ParentID == 0) ? "" : StringUtils.GetCatePrefix(current.Depth - 1, false)) + StringUtils.GetChineseSpell(current.FolderName).Substring(0, 1) + current.FolderName;
                }
                list3.Add(current);
                if (current.ChildCount > 0)
                {
                    list3.AddRange(Folder.GetRelationList(list, current.AutoID));
                }
                num++;
            }
            return(list3);
        }
Beispiel #2
0
        public static List <FolderInfo> GetCateTreeList()
        {
            List <FolderInfo> obj  = (List <FolderInfo>)Folder.GetAllList();
            List <FolderInfo> list = JObject.DeepClone <List <FolderInfo> >(obj);

            return(Folder.GetRelationList(list, 0));
        }