Пример #1
0
 private void InstallMainMenus(IMenu[] menus)
 {
     foreach (IMenuImmutable menu in menus.OfType <IMenuImmutable>())
     {
         metamodel.AddMainMenu(menu);
     }
 }
        private void InstallMainMenus()
        {
            var menus = config.MainMenus?.Invoke(menuFactory);

            // Unlike other things specified in config, this one can't be checked when ReflectorConfiguration is constructed.
            // Allows developer to deliberately not specify any menus
            if (menus != null)
            {
                if (!menus.Any())
                {
                    //Catches accidental non-specification of menus
                    throw new ReflectionException(Log.LogAndReturn("No MainMenus specified."));
                }
                foreach (IMenuImmutable menu in menus.OfType <IMenuImmutable>())
                {
                    metamodel.AddMainMenu(menu);
                }
            }
        }