Пример #1
0
        private void GetItem(string node, BLModal bl, FildType type)
        {
            List <string> branch = this.GetBranch(node);
            List <string> leafs  = GetLeafs(node);

            //具体变量
            for (int i = 0; i < leafs.Count; i++)
            {
                if (type == FildType.User)
                {
                    if (!leafs[i].StartsWith("_"))
                    {
                        BLModal tmpBl = new BLModal()
                        {
                            Name = leafs[i], Parent = bl, ItemType = ItemType.Tag
                        };
                        bl.Children.Add(tmpBl);
                    }
                }
                else if (type == FildType.Sys)
                {
                    if (leafs[i].StartsWith("_"))
                    {
                        BLModal tmpBl = new BLModal()
                        {
                            Name = leafs[i], Parent = bl, ItemType = ItemType.Tag
                        };
                        bl.Children.Add(tmpBl);
                    }
                }
                else if (type == FildType.All)
                {
                    BLModal tmpBl = new BLModal()
                    {
                        Name = leafs[i], Parent = bl, ItemType = ItemType.Tag
                    };
                    bl.Children.Add(tmpBl);
                }
            }

            //导航元素
            for (int i = 0; i < branch.Count; i++)
            {
                if (type == FildType.User)
                {
                    if (!branch[i].StartsWith("_"))
                    {
                        BLModal tmpBl = new BLModal()
                        {
                            Name = branch[i], Parent = bl, ItemType = ItemType.Nav
                        };
                        bl.Children.Add(tmpBl);
                        GetItem(tmpBl.GetID(), tmpBl, FildType.User);
                    }
                }
                else if (type == FildType.Sys)
                {
                    if (branch[i].StartsWith("_"))
                    {
                        BLModal tmpBl = new BLModal()
                        {
                            Name = branch[i], Parent = bl, ItemType = ItemType.Nav
                        };
                        bl.Children.Add(tmpBl);
                        GetItem(tmpBl.GetID(), tmpBl, FildType.Sys);
                    }
                }
                else if (type == FildType.All)
                {
                    BLModal tmpBl = new BLModal()
                    {
                        Name = branch[i], Parent = bl, ItemType = ItemType.Nav
                    };
                    bl.Children.Add(tmpBl);
                    GetItem(tmpBl.GetID(), tmpBl, FildType.All);
                }
            }
        }
Пример #2
0
 public BLModal GetUserNodeTags(string node, FildType type)
 {
     GetItem(node, Filds, type);
     return(Filds);
 }