Esempio n. 1
0
        void SetupMenu()
        {
            // TODO: Use this?
            CommandEntrySet appCes = commandManager.CreateCommandEntrySet(appMenuAddinPath);

            CommandEntrySet ces      = commandManager.CreateCommandEntrySet(commandMenuAddinPath);
            var             mainMenu = new Menu {
                IsMainMenu       = true,
                FocusVisualStyle = null,
            };

            foreach (CommandEntrySet ce in ces)
            {
                var item = new TitleMenuItem(commandManager, ce);
                item.SubmenuClosed += (o, e) =>
                {
                    bool shouldFocusIde = !mainMenu.Items.OfType <MenuItem>().Any(mi => mi.IsSubmenuOpen);
                    if (shouldFocusIde)
                    {
                        IdeApp.Workbench.RootWindow.Present();
                    }
                };
                mainMenu.Items.Add(item);
            }

            titleBar.DockTitle.Children.Add(mainMenu);
            DockPanel.SetDock(mainMenu, Dock.Left);

            commandManager       = null;
            commandMenuAddinPath = appMenuAddinPath = null;
        }
		public override bool SetGlobalMenu (Components.Commands.CommandManager commandManager, string commandMenuAddinPath, string appMenuAddinPath)
		{
			// Only store this information. Release it when creating the main toolbar.
			this.commandManager = commandManager;
			this.commandMenuAddinPath = commandMenuAddinPath;
			this.appMenuAddinPath = appMenuAddinPath;

			return true;
		}
Esempio n. 3
0
        public override bool SetGlobalMenu(Components.Commands.CommandManager commandManager, string commandMenuAddinPath, string appMenuAddinPath)
        {
            // Only store this information. Release it when creating the main toolbar.
            this.commandManager       = commandManager;
            this.commandMenuAddinPath = commandMenuAddinPath;
            this.appMenuAddinPath     = appMenuAddinPath;

            return(true);
        }
Esempio n. 4
0
        void SetupMenu()
        {
            // TODO: Use this?
            CommandEntrySet appCes = commandManager.CreateCommandEntrySet(appMenuAddinPath);

            CommandEntrySet ces      = commandManager.CreateCommandEntrySet(commandMenuAddinPath);
            var             mainMenu = new Menu {
                IsMainMenu       = true,
                FocusVisualStyle = null,
            };

            foreach (CommandEntrySet ce in ces)
            {
                var item = new TitleMenuItem(commandManager, ce, menu: mainMenu);
                mainMenu.Items.Add(item);
            }

            titleBar.DockTitle.Children.Add(mainMenu);
            DockPanel.SetDock(mainMenu, Dock.Left);

            commandManager       = null;
            commandMenuAddinPath = appMenuAddinPath = null;
        }
		void SetupMenu ()
		{
			// TODO: Use this?
			CommandEntrySet appCes = commandManager.CreateCommandEntrySet (appMenuAddinPath);

			CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
			var mainMenu = new Menu {
				IsMainMenu = true,
				FocusVisualStyle = null,
			};
			foreach (CommandEntrySet ce in ces)
			{
				var item = new TitleMenuItem (commandManager, ce, menu: mainMenu);
				mainMenu.Items.Add(item);
			}

			titleBar.DockTitle.Children.Add (mainMenu);
			DockPanel.SetDock (mainMenu, Dock.Left);

			commandManager = null;
			commandMenuAddinPath = appMenuAddinPath = null;
		}
Esempio n. 6
0
		void SetupMenu ()
		{
			// TODO: Use this?
			CommandEntrySet appCes = commandManager.CreateCommandEntrySet (appMenuAddinPath);

			CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
			var mainMenu = new Menu {
				IsMainMenu = true,
				FocusVisualStyle = null,
			};
			foreach (CommandEntrySet ce in ces)
			{
				var item = new TitleMenuItem(commandManager, ce);
				item.SubmenuClosing += (o, e) =>
				{
					bool shouldFocusIde = !mainMenu.Items.OfType<MenuItem>().Any(mi => mi.IsSubmenuOpen);
					if (shouldFocusIde)
						IdeApp.Workbench.RootWindow.Present();
				};
				mainMenu.Items.Add(item);
			}

			titleBar.DockTitle.Children.Add (mainMenu);
			DockPanel.SetDock (mainMenu, Dock.Left);

			commandManager = null;
			commandMenuAddinPath = appMenuAddinPath = null;
		}