@@ -57,14 +57,15 @@ public static IEnumerable<ToolStripItem> CreateToolStripButtons(Action<Type> han
5757
5858 return CreateToolStripItems ( t =>
5959 {
60- GetNodeInfoFromType ( t , out var label , out var icon ) ;
60+ GetNodeInfoFromType ( t , out var label , out var icon , out var shortcutKeys ) ;
6161
62- var item = new TypeToolStripButton
62+ var item = new TypeToolStripMenuItem
6363 {
6464 Value = t ,
6565 ToolTipText = label ,
6666 DisplayStyle = ToolStripItemDisplayStyle . Image ,
67- Image = icon
67+ Image = icon ,
68+ ShortcutKeys = shortcutKeys ,
6869 } ;
6970 item . Click += clickHandler ;
7071 return item ;
@@ -74,7 +75,7 @@ public static IEnumerable<ToolStripItem> CreateToolStripButtons(Action<Type> han
7475 Image = p . Icon
7576 } , t =>
7677 {
77- GetNodeInfoFromType ( t , out var label , out var icon ) ;
78+ GetNodeInfoFromType ( t , out var label , out var icon , out var shortcutKeys ) ;
7879
7980 var item = new TypeToolStripMenuItem
8081 {
@@ -95,13 +96,14 @@ public static IEnumerable<ToolStripItem> CreateToolStripMenuItems(Action<Type> h
9596
9697 var items = CreateToolStripItems ( t =>
9798 {
98- GetNodeInfoFromType ( t , out var label , out var icon ) ;
99+ GetNodeInfoFromType ( t , out var label , out var icon , out var shortcutKeys ) ;
99100
100101 var item = new TypeToolStripMenuItem
101102 {
102103 Value = t ,
103104 Text = label ,
104- Image = icon
105+ Image = icon ,
106+ ShortcutKeys = shortcutKeys ,
105107 } ;
106108 item . Click += clickHandler ;
107109 return item ;
@@ -166,10 +168,12 @@ private static IEnumerable<ToolStripItem> CreateToolStripItems(Func<Type, ToolSt
166168 return items ;
167169 }
168170
169- private static void GetNodeInfoFromType ( Type nodeType , out string label , out Image icon )
171+ private static void GetNodeInfoFromType ( Type nodeType , out string label , out Image icon , out Keys shortcutKeys )
170172 {
171173 Contract . Requires ( nodeType != null ) ;
172174
175+ shortcutKeys = Program . Settings . GetShortcutKeyForNodeType ( nodeType ) ;
176+
173177 var node = BaseNode . CreateInstanceFromType ( nodeType , false ) ;
174178 if ( node == null )
175179 {
0 commit comments