Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VSIX AddNamedCommand2 equivalent

$
0
0
I porting my add-in to a VS package and not sure how to replace this code that create a new command:
Command cmd = ((Commands2)_applicationObject.Commands).AddNamedCommand2(_addInInstance,"MyCommand","My Command...","My Command...",
                                true, -1, ref contextGUIDS,
                                (int)vsCommandStatus.vsCommandStatusSupported +
                                (int)vsCommandStatus.vsCommandStatusEnabled,
                                (int)vsCommandStyle.vsCommandStylePictAndText,
                                vsCommandControlType.vsCommandControlTypeButton);
 CommandBar toolsCmdBar = ((CommandBars)_applicationObject.CommandBars)["Tools"];
            cmd.AddControl(toolsCmdBar, toolsCmdBar.Controls.Count + 1);

I also need to replace IDTExtensibility2.QuerySTatus that I used to manage the status of the command.

Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>