I’m using GoDiagram as a control to display some GoBasicNode’s depending on what the user selects/clicks in an other window. It works fine for a couple of “clicks” but then the GoDiagram control crashes and displays just a red cross. The exception text is as follows:’
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”>**************
Exception Text **************<?: prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”>System.InvalidOperationException:
Collection was modified; enumeration operation may not execute.<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
System.Collections.Generic.List`1.Enumerator.MoveNextRare()<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at System.Collections.Generic.List`1.Enumerator.MoveNext()<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at Northwoods.Go.GoLayer.Paint(Graphics g,
GoView view, RectangleF clipRect)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at Northwoods.Go.GoView.PaintObjects(Boolean
doc, Boolean view, Graphics g, RectangleF clipRect)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at Northwoods.Go.GoView.PaintView(Graphics
g, RectangleF clipRect)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
Northwoods.Go.GoView.onPaintCanvas(PaintEventArgs evt)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
Northwoods.Go.GoView.OnPaint(PaintEventArgs evt)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16
layer)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at System.Windows.Forms.Control.WmPaint(Message&
m)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
System.Windows.Forms.Control.WndProc(Message& m)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<o:p></o:p>
<p style=“margin: 0cm 0cm 0pt;” =“Msonormal”> at System.Windows.Forms.NativeWindow.Callback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The behaviour is complete random, clicked objects that displayed the GoBasicNodes in the control correctly for one or several times may cause the control to crash some later time without any changes in the content.
I'm using .NET 4.0.
Any suggestions
BR,
Juri