@@ -26,6 +26,7 @@ You should have received a copy of the GNU General Public License
2626using System . IO ;
2727using libEDSsharp ;
2828using Xml2CSharp ;
29+ using static System . Windows . Forms . VisualStyles . VisualStyleElement ;
2930
3031namespace ODEditor
3132{
@@ -183,6 +184,7 @@ private void openEDSfile(string path,InfoSection.Filetype ft)
183184
184185 DeviceView device = new DeviceView ( eds , network ) ;
185186
187+ device . UpdateODViewForEDS += Device_UpdateODViewForEDS ;
186188 eds . OnDataDirty += Eds_onDataDirty ;
187189
188190 tabControl1 . TabPages . Add ( eds . di . ProductName ) ;
@@ -337,6 +339,7 @@ private void openXDDfile(string path)
337339
338340 DeviceView device = new DeviceView ( eds , network ) ;
339341
342+ device . UpdateODViewForEDS += Device_UpdateODViewForEDS ;
340343 eds . OnDataDirty += Eds_onDataDirty ;
341344
342345 tabControl1 . TabPages [ tabControl1 . TabPages . Count - 1 ] . Controls . Add ( device ) ;
@@ -382,7 +385,7 @@ private void openXMLfile(string path)
382385 tabControl1 . TabPages . Add ( eds . di . ProductName ) ;
383386
384387 DeviceView device = new DeviceView ( eds , network ) ;
385-
388+ device . UpdateODViewForEDS += Device_UpdateODViewForEDS ;
386389 eds . OnDataDirty += Eds_onDataDirty ;
387390
388391 tabControl1 . TabPages [ tabControl1 . TabPages . Count - 1 ] . Controls . Add ( device ) ;
@@ -405,6 +408,26 @@ private void openXMLfile(string path)
405408
406409 }
407410
411+ private void Device_UpdateODViewForEDS ( object sender , UpdateODViewEventArgs e )
412+ {
413+ foreach ( TabPage page in tabControl1 . TabPages )
414+ {
415+ foreach ( Control c in page . Controls )
416+ {
417+ if ( c . GetType ( ) == typeof ( DeviceView ) )
418+ {
419+ DeviceView d = ( DeviceView ) c ;
420+ if ( d . eds == e . EDS )
421+ {
422+ d . dispatch_updateOD ( ) ;
423+ }
424+ }
425+
426+ }
427+ }
428+ }
429+
430+
408431 private void Eds_onDataDirty ( bool dirty , EDSsharp sender )
409432 {
410433 foreach ( TabPage page in tabControl1 . TabPages )
@@ -648,6 +671,7 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e)
648671 tabControl1 . TabPages . Add ( eds . di . ProductName ) ;
649672
650673 DeviceView device = new DeviceView ( eds , network ) ;
674+ device . UpdateODViewForEDS += Device_UpdateODViewForEDS ;
651675
652676 eds . OnDataDirty += Eds_onDataDirty ;
653677
@@ -896,6 +920,7 @@ private void openXDDNetworkfile(string file)
896920 device . Dock = DockStyle . Fill ;
897921
898922 network . Add ( eds ) ;
923+ device . UpdateODViewForEDS += Device_UpdateODViewForEDS ;
899924 eds . OnDataDirty += Eds_onDataDirty ;
900925
901926 device . dispatch_updateOD ( ) ;
@@ -927,6 +952,7 @@ private void openNetworkfile(string file)
927952 device . Dock = DockStyle . Fill ;
928953
929954 network . Add ( eds ) ;
955+ device . UpdateODViewForEDS += Device_UpdateODViewForEDS ;
930956 eds . OnDataDirty += Eds_onDataDirty ;
931957
932958 device . dispatch_updateOD ( ) ;
0 commit comments