public DTE_CommandBar FindCommandBar(string InName) { Microsoft.VisualStudio.CommandBars.CommandBar cb = ((Microsoft.VisualStudio.CommandBars.CommandBars)mDte2.CommandBars)[InName]; DTE_CommandBar cmdBar = new DTE_CommandBar(this, cb); return(cmdBar); }
public DTE_CommandBar AddCommandBar() { Microsoft.VisualStudio.CommandBars.CommandBar cmdbar = null; DTE_CommandBar bar = new DTE_CommandBar(mMain, cmdbar); return(bar); // myPermanentCommandBar1 = // (Microsoft.VisualStudio.CommandBars.CommandBar) // InMain.dte2.Commands.AddCommandBar( // MY_PERMANENT_COMMANDBAR_POPUP1_NAME, // EnvDTE.vsCommandBarType.vsCommandBarTypeMenu, // toolsCmdBar.cmdbar, toolsCmdBar.cmdbar.Controls.Count + 1); // myPermanentCommandBar1.Enabled = true; }
// ---------------------- AddCommandBar ----------------------------- public DTE_CommandBar AddCommandBar( string InBarName) { Microsoft.VisualStudio.CommandBars.CommandBar envBar = null; DTE_CommandBar addBar = null; envBar = (Microsoft.VisualStudio.CommandBars.CommandBar) mMain.dte2.Commands.AddCommandBar( InBarName, EnvDTE.vsCommandBarType.vsCommandBarTypeMenu, this.cmdbar, this.cmdbar.Controls.Count + 1); envBar.Enabled = true; addBar = new DTE_CommandBar(mMain, envBar); return(addBar); }