Esempio n. 1
0
        protected override void Initialize()
        {
            base.Initialize();

            var menus = ServiceProvider.GetExportedValue <IMenuProvider>();

            foreach (var menu in menus.Menus)
            {
                ServiceProvider.AddTopLevelMenuItem(menu.Guid, menu.CmdId, (s, e) => menu.Activate());
            }

            foreach (var menu in menus.DynamicMenus)
            {
                ServiceProvider.AddDynamicMenuItem(menu.Guid, menu.CmdId, menu.CanShow, menu.Activate);
            }
        }