10

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:

  • Action.Add
  • Action.Add.NETFrameworkLaunchCondition
  • Action.AddAction
  • ... etc.

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

Byron Sommardahl
  • 12,743
  • 15
  • 74
  • 131

3 Answers3

9

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...

Jason Malinowski
  • 18,148
  • 1
  • 38
  • 55
  • There isn't really an async version. The EnvDTE API is affinitized to the UI thread. You could run that on a background thread, but you'll trigger marshaling back to the UI thread transparently which would make the code even slower than it is normally. In the end of the day, enumerating all commands is really one of those "don't do it" things. Normally if somebody asks for this I push back and challenge them why they need to do it. – Jason Malinowski Dec 11 '14 at 19:09
3

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

burning_LEGION
  • 13,246
  • 8
  • 40
  • 52
0

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

bbsimonbb
  • 27,056
  • 15
  • 80
  • 110