Example #1
0
        private IEnumerable <MenuItem> BuildAddOnMenu()
        {
            var menuRequests = _menuChangers.Select(x => new
            {
                StartMenu      = new MenuBuilder(),
                MenuConfigurer = x.Configure()
            }).ToList();

            var menuItems = menuRequests.SelectMany(rq =>
            {
                rq.MenuConfigurer(rq.StartMenu);
                return(rq.StartMenu.Build());
            });

            var addons = new MenuBuilder();

            addons.AddDropdown("Add-Ons").AddItems(menuItems);
            return(addons.Build());
        }