Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unhandled Exception with the diagram (Read 2523 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Unhandled Exception with the diagram
Apr 18th, 2011 at 11:08am
Print Post  
Hi,
Our application is based on client server model where each instance is synchronized with the server. In our application we are having some shape nodes (30+) and some diagram links. We are getting unhandled exception while performing following operation in the diagram.


1. Deleting devices and links from one instance
2. At the same time, copying those devices from another instance and pasting in the diagram. While nodes are deleting we are also trying to select those nodes which are just going to delete.
3. After 3 -4 iterations we get this unhandled exception.

Code
Select All
bgEventProcessingThread_DoWork: inner loop...
   at MindFusion.Diagramming.Wpf.DiagramNode.x19a8a761a691d529(Rect xa6236fc5cd405c4e, Point x2f7096dac971d6ec, InteractionState xab29833053004740)
   at MindFusion.Diagramming.Wpf.DiagramNode.x690a7db222c5c9f0(Rect xfcad4c0a9c5890c6, Rect x3bd62873fafa6252, Point x2f7096dac971d6ec, AdjustmentHandles xe72ccf98bea3cb87, InteractionState xab29833053004740)
   at MindFusion.Diagramming.Wpf.DiagramNode.AllowModify(Point current, InteractionState ist)
   at MindFusion.Diagramming.Wpf.ShapeNode.AllowModify(Point current, InteractionState ist)
   at MindFusion.Diagramming.Wpf.InteractionState.ValidateAndSetCursor(Point point, Diagram diagram)
   at MindFusion.Diagramming.Wpf.Behaviors.BehaviorBase.OnMouseMove(Point mousePosition)
   at MindFusion.Diagramming.Wpf.Diagram.OnPreviewMouseMove(MouseEventArgs e)
   at System.Windows.UIElement.OnPreviewMouseMoveThunk(Object sender, MouseEventArgs e)
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  


Could you please let know which is this interaction state xab29833053004740?

Please suggest suitable solution for this problem.

Note- When we are selecting those devices which are just about to delete, we are already checking these diagram properties still we are getting unhandled exception.

Code
Select All
if (diagram.Interaction != null && diagram.Interaction.CurrentItem == diagram.Selection && !diagram.Interaction.IsCompleting() &&
		   (diagram.Interaction.Action == MindFusion.Diagramming.Wpf.Action.Create || diagram.Interaction.Action == MindFusion.Diagramming.Wpf.Action.Modify))
		{
		    diagram.CancelDrag();
		} 


Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Unhandled Exception with the diagram
Reply #1 - Apr 18th, 2011 at 11:29am
Print Post  
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Unhandled Exception with the diagram
Reply #2 - Apr 18th, 2011 at 11:34am
Print Post  
Hi Stoyan,

"Do not delete items while they are being modified. Instead queue them up if you detect that diagram.Interaction is != null, and delete the queued items after the user stops drawing with the mouse."
To avoid this case we are checking all those conditions. Please let know if any more condition is required to check.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Unhandled Exception with the diagram
Reply #3 - Apr 18th, 2011 at 4:47pm
Print Post  
Hi Anshul,

You might be checking for these conditions but apparently you are still deleting an item from within the context of a Modifying event handler, which is not supported at this time. Instead of immediately deleting the items, queue them up for later deletion once the modification has completed. E.g. when you get a message from the server, store the item in a List<DiagramItem>, and later when diagram.Interaction is null remove the queued items from the diagram. That 'later' point could be a MouseUp event handler, or all of the Modified/Cancelled event handlers.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint