示例#1
0
        private void SetNodes(SiteFrontend.CategoryHierarchy.Category cat, ref TreeNode addInNode)
        {
            TreeNode childNode;

            SiteFrontend.CategoryHierarchy.CategoryCollection childrens = cat.GetChildren() as
                                                                          SiteFrontend.CategoryHierarchy.CategoryCollection;
            foreach (SiteFrontend.CategoryHierarchy.Category child in childrens)
            {
                childNode             = new TreeNode(child.Name);
                childNode.NavigateUrl = child.NavigateURL;
                childNode.Value       = child.CategoryId.ToString();
                //debug
                //logger.Debug("# HasChildren - " + child.Name);
                if (child.HasChildren)
                {
                    SetNodes(child, ref childNode);
                }
                if (_curentCategoryID == child.CategoryId)
                {
                    _curentSectionID = child.SectionId;
                    _currentNode     = childNode;
                }
                addInNode.ChildNodes.Add(childNode);
            }
        }
示例#2
0
        private void SetNodes(SiteFrontend.CategoryHierarchy.Category cat, ref TreeNode addInNode)
        {
            TreeNode childNode;

            SiteFrontend.CategoryHierarchy.CategoryCollection childrens = cat.GetChildren() as
                                                                          SiteFrontend.CategoryHierarchy.CategoryCollection;

            foreach (SiteFrontend.CategoryHierarchy.Category child in childrens)
            {
                childNode             = new TreeNode(child.Name);
                childNode.NavigateUrl = child.NavigateURL;
                childNode.Value       = child.CategoryId.ToString();
                //if (child.HasChildren)
                //{
                //    SetNodes(child, ref childNode);
                //}
                if (_categoryID == child.CategoryId)
                {
                    _currentNode = childNode;
                }
                addInNode.ChildNodes.Add(childNode);
            }
        }