コード例 #1
0
        public ISGSideBarUIService AddRoot(int groupId, LSIDEBAR categoryId, string fromName, string toName, string icon, string path,
                                           string badgeType = "", string badgeValue = "", string tooltip = "",
                                           bool actived     = false, bool expanded  = false)
        {
            ISGSideBarUI menuItem = new SGSideBarUI
            {
                GroupId    = groupId,
                Idx        = -1,
                ParentId   = -1,
                CategoryId = categoryId,
                Parent     = null,
                FromName   = fromName,
                ToName     = toName,
                Icon       = icon,
                Path       = path,
                ToolTip    = tooltip,
                BadgeType  = badgeType,
                BadgeValue = badgeValue,
                Actived    = actived,
                Expanded   = expanded,
                IsSubMenu  = false,
                Child      = null
            };

            // Same: MenuList.add(menuItem);
            MenuList.Add(menuItem);

            return(this);
        }
コード例 #2
0
        public ISGSideBarUIService AddMenu(int groupId, int Id, LSIDEBAR categoryId, string name, string icon, string path,
                                           string badgeType = "", string badgeValue = "", string tooltip = "",
                                           bool actived     = false, bool expanded  = false, bool bUse   = true)
        {
            if (!bUse)
            {
                return(this);
            }
            ISGSideBarUI menuItem = new SGSideBarUI
            {
                GroupId    = groupId,
                Idx        = Id,
                ParentId   = Id,
                CategoryId = categoryId,
                Parent     = MenuList[groupId],
                FromName   = "",
                ToName     = name,
                Icon       = icon,
                Path       = path,
                ToolTip    = tooltip,
                BadgeType  = badgeType,
                BadgeValue = badgeValue,
                Actived    = actived,
                Expanded   = expanded,
                IsSubMenu  = true,
                Child      = null
            };

            // Same: MenuList[groupId].Child.add(menuItem);

            (MenuList[groupId] as SGSideBarUI).Child ??= new List <ISGSideBarUI>();
            MenuList[groupId].Child?.Add(menuItem);

            return(this);
        }
コード例 #3
0
        public ISGSideBarUIService AddSubMenu(int groupId, int menuId, string name, string icon, string path,
                                              string badgeType = "", string badgeValue = "", string tooltip = "",
                                              bool actived     = false, bool expanded  = false)
        {
            ISGSideBarUI menuItem = new SGSideBarUI
            {
                GroupId    = groupId,
                MenuId     = menuId,
                Parent     = MenuList[groupId],
                Name       = name,
                Icon       = icon,
                Path       = path,
                ToolTip    = tooltip,
                BadgeType  = badgeType,
                BadgeValue = badgeValue,
                Actived    = actived,
                Expanded   = expanded,
                IsSubMenu  = true,
                //Child = new List<ISGSideBarUI>()
                Child = null
            };

            // Same: MenuList[groupId].Child.add(menuItem);
            (MenuList[groupId] as SGSideBarUI).Child ??= new List <ISGSideBarUI>();
            MenuList[groupId].Child.Add(menuItem);

            return(this);
        }