Exemplo n.º 1
0
 public static void FillNavBar(NavBarControl navBar, NavBarGroupStyle groupStyle, NavBarImage groupCaptionImage)
 {
     if (navBar == null)
     {
         return;
     }
     navBar.BeginUpdate();
     for (int i = 0; i < Count; i++)
     {
         if (GetItem(i).Group == ConstStrings.Get("AboutGroup"))
         {
             continue;
         }
         NavBarItem item = new NavBarItem();
         navBar.Items.Add(item);
         item.Caption = GetItem(i).Name;
         item.Tag     = GetItem(i);
         GetNavBarGroup(navBar, GetItem(i).Group, groupStyle, groupCaptionImage).ItemLinks.Add(new NavBarItemLink(item));
     }
     navBar.EndUpdate();
 }
Exemplo n.º 2
0
        static NavBarGroup GetNavBarGroup(NavBarControl navBar, string groupName, NavBarGroupStyle groupStyle, NavBarImage groupCaptionImage)
        {
            foreach (NavBarGroup group in navBar.Groups)
            {
                if (group.Caption == groupName)
                {
                    return(group);
                }
            }
            NavBarGroup newGroup = navBar.Groups.Add();

            newGroup.Caption              = groupName;
            newGroup.Name                 = groupName;
            newGroup.GroupStyle           = groupStyle;
            newGroup.GroupCaptionUseImage = groupCaptionImage;
            return(newGroup);
        }