Search code examples
c#visual-studio-2010visual-studio-addins

How to find the available EnvDTE.Comands names for Visual Stuadio 2010?


I am creating an Add-In for Visual Studio 2010. Using this Addin I want to add some extra functionality when the user is typing to the editor or copies some text from it.

I searched over the Web to find out what are the command names that Visual Studio executes to add events for these commands. But I didn't find something realy helpful. All I found is some examples and just by luck I saw that the copy-command name is "Edit.Copy".

Is there a way to print all available commands from Visual Studio? Any useful link will be very helpful too.


Solution

  • I finally managed to print the commands with the following code:

    private void EnumerateCommads()
    {
        foreach (Command command in _applicationObject.Commands)
        {
            //print command
        }
    }