示例#1
0
        public MenuBuilder AddSubMenu(int position, string caption, MenuBuilder menuItems, bool isVisible = true, bool isEnabled = true)
        {
            var menuItem = new MenuElement();

            menuItem.Position  = position;
            menuItem.IsSubMenu = true;
            menuItem.Caption   = caption;
            menuItem.MenuItems = menuItems;
            menuItem.IsVisible = isVisible;
            menuItem.IsEnabled = isEnabled;

            _menuItems.Add(menuItem);
            return(this);
        }
示例#2
0
        public MenuBuilder AddItem(int position, string caption, string link, bool isVisible = true, bool isEnabled = true)
        {
            var menuItem = new MenuElement
            {
                Position  = position,
                Caption   = caption,
                Link      = link,
                IsSubMenu = false,
                IsVisible = isVisible,
                IsEnabled = isEnabled
            };

            _menuItems.Add(menuItem);

            return(this);
        }
示例#3
0
 public MenuBuilder AddItem(MenuElement menuItem)
 {
     _menuItems.Add(menuItem);
     return(this);
 }