public void BuildMenuBar(MesMenuBarDefinition menuBarDefinition, MesMenuModel result)
        {
            IOrderedEnumerable <MesMenuDefinition> menus = _menus
                                                           .Where(x => x.MenuBar == menuBarDefinition)
                                                           .Where(x => !_excludeMenus.Contains(x))
                                                           .OrderBy(x => x.SortOrder);

            foreach (MesMenuDefinition menu in menus)
            {
                MesTextMenuItem menuModel = new MesTextMenuItem(menu);
                AddGroupsRecursive(menu, menuModel);
                if (menuModel.Children.Any())
                {
                    result.Add(menuModel);
                }
            }
        }
Example #2
0
 public MesMenuDefinition(MesMenuBarDefinition menuBar, int sortOrder, string text)
 {
     _menuBar   = menuBar;
     _sortOrder = sortOrder;
     _text      = text;
 }