@@ -22,7 +22,8 @@ public class MidiForm : ToolWindow, IDisposable
22
22
private ToolStripMenuItem toolsToolStripMenuItem ;
23
23
private ToolStripMenuItem exportRuleSetsToolStripMenuItem ;
24
24
private ToolStripMenuItem importRuleSetsToolStripMenuItem ;
25
- private ToolStripMenuItem infoToolStripMenuItem ;
25
+ private ToolStripMenuItem updateDevicesToolStripMenuItem ;
26
+ private ToolStripMenuItem infoToolStripMenuItem ;
26
27
public MidiForm ( )
27
28
{
28
29
this . InitializeComponent ( ) ;
@@ -140,6 +141,7 @@ private void InitializeComponent()
140
141
this . devicesGrid = new System . Windows . Forms . DataGridView ( ) ;
141
142
this . rulesGrp = new System . Windows . Forms . GroupBox ( ) ;
142
143
this . rulesGrid = new System . Windows . Forms . DataGridView ( ) ;
144
+ this . updateDevicesToolStripMenuItem = new System . Windows . Forms . ToolStripMenuItem ( ) ;
143
145
this . menuStrip1 . SuspendLayout ( ) ;
144
146
this . splitContainer . Panel1 . SuspendLayout ( ) ;
145
147
this . splitContainer . Panel2 . SuspendLayout ( ) ;
@@ -155,6 +157,7 @@ private void InitializeComponent()
155
157
this . menuStrip1 . Items . AddRange ( new System . Windows . Forms . ToolStripItem [ ] {
156
158
this . addRuleSetToolStripMenuItem ,
157
159
this . deleteRuleSetToolStripMenuItem ,
160
+ this . updateDevicesToolStripMenuItem ,
158
161
this . infoToolStripMenuItem ,
159
162
this . toolsToolStripMenuItem } ) ;
160
163
this . menuStrip1 . Location = new System . Drawing . Point ( 0 , 0 ) ;
@@ -204,6 +207,13 @@ private void InitializeComponent()
204
207
this . importRuleSetsToolStripMenuItem . Text = "Import RuleSets" ;
205
208
this . importRuleSetsToolStripMenuItem . Click += new System . EventHandler ( this . importRuleSetsToolStripMenuItem_Click ) ;
206
209
//
210
+ // updateDevicesToolStripMenuItem
211
+ //
212
+ this . updateDevicesToolStripMenuItem . Name = "updateDevicesToolStripMenuItem" ;
213
+ this . updateDevicesToolStripMenuItem . Size = new System . Drawing . Size ( 100 , 20 ) ;
214
+ this . updateDevicesToolStripMenuItem . Text = "Update Devices" ;
215
+ this . updateDevicesToolStripMenuItem . Click += new System . EventHandler ( this . updateDevicesToolStripMenuItem_Click ) ;
216
+ //
207
217
// splitContainer
208
218
//
209
219
this . splitContainer . Dock = System . Windows . Forms . DockStyle . Fill ;
@@ -286,6 +296,7 @@ private void InitializeComponent()
286
296
this . menuStrip1 . PerformLayout ( ) ;
287
297
this . splitContainer . Panel1 . ResumeLayout ( false ) ;
288
298
this . splitContainer . Panel2 . ResumeLayout ( false ) ;
299
+ ( ( System . ComponentModel . ISupportInitialize ) ( this . splitContainer ) ) . EndInit ( ) ;
289
300
this . splitContainer . ResumeLayout ( false ) ;
290
301
this . devicesGrp . ResumeLayout ( false ) ;
291
302
( ( System . ComponentModel . ISupportInitialize ) ( this . devicesGrid ) ) . EndInit ( ) ;
@@ -310,5 +321,12 @@ private void importRuleSetsToolStripMenuItem_Click(object sender, EventArgs e)
310
321
if ( Import != null ) Import ( null , null ) ;
311
322
}
312
323
313
- }
324
+ private void updateDevicesToolStripMenuItem_Click ( object sender , EventArgs e )
325
+ {
326
+ ContextManager . DeviceInformation . DeviceUpdate ( ) ;
327
+ this . devicesGrid . DataSource = typeof ( System . Collections . Generic . List < MidiDev > ) ;
328
+ this . devicesGrid . DataSource = ContextManager . DeviceInformation . Devices ;
329
+ this . UpdateUi ( ) ;
330
+ }
331
+ }
314
332
}
0 commit comments