GoView animation


#1

How to properly implement the diagram animation.
Just suppose that the diagram is dynamic. I want to have the node slowly moving over the diagram and during that movement i want to add additional nodes/links. I have one thread that does animation, and another that adds new nodes to the diagram, threads are supposed to run together for a long time.
I’ve tried but got exception
************** Exception Text **************
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at Northwoods.Go.GoView.OnPaint(PaintEventArgs evt)
at Diagram.OntosDiagram.OnPaint(PaintEventArgs evt)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEve ntArgs e, Int16 layer, Boolean disposeEventArgs)


#2

Well, as the error message says, you must be modifying something while the GoView thread is painting. That’s a no-no.
The Processor sample does some animation, although not exactly the kind you want. The WebWalker sample uses a separate thread for crawling the web.