Byron Sommardahl
Byron Sommardahl

Reputation: 13012

How to get list of Visual Studio commands?

We are working on an VS extension that requires a list of Visual Studio commands like the one in this screen shot:

Screen Shot from Visual Studio 2010, Tools > Options > Keyboard

Example:

Where can we find or how can we access this list?

Upvotes: 10

Views: 3272

Answers (3)

bbsimonbb
bbsimonbb

Reputation: 29022

Here is a handy list of VS commands compiled by Mads Kristensen for his VS VoiceExtension.

Upvotes: 0

Jason Malinowski
Jason Malinowski

Reputation: 19031

You can access it via the DTE interfaces. Get the EnvDTE.DTE interface via GetService(typeof(SDTE)) (or other appropriate mechanism) and then:

EnvDTE.DTE dte = ...;
var commands = dte.Commands.Cast<EnvDTE.Command>();

foreach (var command in commands.OrderBy(c => c.Name))
{
    Console.WriteLine(command.Name);
}

I should mention this can be quite slow, so it's best avoided if you can...

Upvotes: 9

burning_LEGION
burning_LEGION

Reputation: 13460

visual studio contains this lists ...\Microsoft Visual Studio 9.0\Common7\IDE\*.vsk

Upvotes: 3

Related Questions