Exemple #1
0
        /// <summary>
        /// Registers new item for solution-explorer.
        /// </summary>
        public void AddSolutionExplorerItem(MenuCommand menuCommand, bool alsoMdiMenu, bool beginGroup, int itemIndex, params string[] afterItemCaption)
        {
            IMenuCreator menuCreator = manager.MenuCreator;

            if (menuCreator.IsSetupUI)
            {
                string[] commandBarNames = (alsoMdiMenu ? SolutionTreeMdiContextMenu : SolutionTreeMenu);

                foreach (string n in commandBarNames)
                {
                    // find proper command-bar:
                    CommandBar cmdBar = menuCreator.GetCommandBar(n);

                    // try to insert new element:
                    if (cmdBar != null)
                    {
                        menuCreator.AddButton(cmdBar, menuCommand, beginGroup, itemIndex, afterItemCaption);
                    }
                }
            }
        }