1: Imports System
2: Imports EnvDTE
3: Imports EnvDTE90
4: Imports System.Diagnostics
5:
6:
7: Public Module ShowVisualStudio2008Shortcuts
8:
9:
10: Public Sub ListShortcutsInHTML()
11:
12:
13: 'Declare a StreamWriter
14: Dim s As New System.IO.FileStream("c:\\VisualStudio2008ShortCuts.html", _
15: IO.FileMode.OpenOrCreate)
16: Dim sw As System.IO.StreamWriter
17: sw = New System.IO.StreamWriter(s)
18:
19:
20: 'Write the beginning HTML
21: WriteHTMLStart(sw)
22:
23:
24: ' Add a row for each keyboard shortcut
25: For Each c As EnvDTE.Command In DTE.Commands
26:
27:
28: If c.Name <> "" Then
29: Dim bindings As System.Array
30: bindings = CType(c.Bindings, System.Array)
31:
32:
33: For i As Integer = 0 To bindings.Length - 1
34: sw.WriteLine("<tr>")
35: sw.WriteLine("<td>" + c.Name + "</td>")
36: sw.WriteLine("<td>" + bindings(i) + "</td>")
37: sw.WriteLine("</tr>")
38: Next i
39: End If
40: Next
41:
42:
43: 'Write the end HTML
44: WriteHTMLEnd(sw)
45:
46:
47: 'Flush and close the stream
48: sw.Flush()
49: sw.Close()
50: End Sub
51:
52:
53:
54:
55: Public Sub WriteHTMLStart(ByVal sw As System.IO.StreamWriter)
56: sw.WriteLine("<html>")
57: sw.WriteLine("<head>")
58: sw.WriteLine("<title>")
59: sw.WriteLine("Visual Studio Keyboard Shortcuts")
60: sw.WriteLine("</title>")
61: sw.WriteLine("</head>")
62: sw.WriteLine("<body>")
63: sw.WriteLine("<h1>Visual Studio 2005 Keyboard Shortcuts</h1>")
64: sw.WriteLine("<font size=""2"" face=""Verdana"">")
65: sw.WriteLine("<table border=""1"">")
66: sw.WriteLine("<tr BGCOLOR=""#018FFF""><td align=""center"">" & _
67: "<b>Command</b></td><td align=""center"">" & _
68: "<b>Shortcut</b></td></tr>")
69: End Sub
70:
71:
72:
73:
74: Public Sub WriteHTMLEnd(ByVal sw As System.IO.StreamWriter)
75: sw.WriteLine("</table>")
76: sw.WriteLine("</font>")
77: sw.WriteLine("</body>")
78: sw.WriteLine("</html>")
79: End Sub
80:
81:
82: End Module