Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Null exception when copying DiagramLink (Read 4089 times)
Nic
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Feb 18th, 2015
Null exception when copying DiagramLink
Aug 22nd, 2015 at 9:11pm
Print Post  
I'm completely lost here

The stack trace is baffling to me and I have no idea what to do to correct it. I have tried to assign every null value I can to some sort of default but nothing is working. This only applies to DiagramLink it seems, nodes are fine.

Code
Select All
   at MindFusion.Diagramming.DiagramLink.GetBounds()
   at MindFusion.Diagramming.DiagramLink.GetRepaintRect(Boolean includeConnected)
   at MindFusion.Diagramming.DiagramItem.Repaint(Boolean includeConnected)
   at MindFusion.Diagramming.DiagramItem.Repaint()
   at MindFusion.Diagramming.DiagramItem.OnStyleChanged()
   at MindFusion.Diagramming.DiagramLink.OnStyleChanged()
   at MindFusion.Diagramming.DiagramItem.set_Style(DiagramItemStyle value)
   at MindFusion.Diagramming.DiagramItem..ctor(DiagramItem prototype)
   at MindFusion.Diagramming.DiagramLink..ctor(DiagramLink prototype, DiagramNode src, DiagramNode dest)
   at MindFusion.Diagramming.DiagramLink.Clone(Boolean clipboard)
   at MindFusion.Diagramming.Diagram.CopySelection(Diagram source, Boolean unconnectedLinks, Boolean copyGroups)
   at MindFusion.Diagramming.WinForms.DiagramView.cf1f857f12a36af3d80820768347ebbc7(Boolean cabf948b187917993e7dcde93be162ae6, Boolean cc887c6fbd0930c1fc47ed70c20e9457e)
   at MindFusion.Diagramming.WinForms.DiagramView.CopyToClipboard(Boolean persist, Boolean groups)
   at MindFusion.Diagramming.WinForms.DiagramView.CopyToClipboard(Boolean persist) 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Null exception when copying DiagramLink
Reply #1 - Aug 24th, 2015 at 8:26am
Print Post  
This build should fix it:
https://www.mindfusion.eu/_temp/copy_link.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Nic
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Feb 18th, 2015
Re: Null exception when copying DiagramLink
Reply #2 - Aug 25th, 2015 at 12:36am
Print Post  
I can't use the assemblies. I tried both the CLR2 and 4 version, they both came back with:

Code
Select All
Error	1	'Could not load file or assembly 'MindFusion.Diagramming.WinForms, Version=6.1.3.25975, Culture=neutral, PublicKeyToken=a0d18338041985ba' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)'	 


  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Null exception when copying DiagramLink
Reply #3 - Aug 25th, 2015 at 8:03am
Print Post  
Recent version of the Diagramming.WinForms assembly requires a Common.WinForms.dll reference; try adding it to your project as well.
  
Back to top
 
IP Logged
 
Nic
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Feb 18th, 2015
Re: Null exception when copying DiagramLink
Reply #4 - Aug 25th, 2015 at 8:40am
Print Post  
While I hadn't needed to include that dll before (and thus didn't have it referenced), adding it hasn't changed the result. Same error as before.

Same token, same error code.

Update: I forgot about the last time this happened, but I had to "Unblock" each dll in Windows because they had been downloaded.

I can compile now. Will update if it resolves copy issue.

Update: Can confirm that the new library has solved the copy issue for arrows, however in the meantime we found another problem. (Which happened on the old libraries and the new ones)

What's happening now is that when creating a node the anchor points seem to be disappearing and being assigned to null. It only seems to happen to the shape based on the rectangle and happens in between the diagram_ItemAdded and the diagram_NodeCreated events. None of our code runs between these two events (The diagram_ItemAdded event handler was left blank only to have a place to single step to).

The node is created from a drag and drop from a ShapeListBox and at the point of selecting the shape it also stlil had the anchor points.

Prior to this the Id of the shape was being removed instead. I don't know what happened to cause the switch but now the ID is fine and the anchor points are gone. (Happened on both old and new library sets).
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Null exception when copying DiagramLink
Reply #5 - Aug 25th, 2015 at 5:56pm
Print Post  
Do you use Shape.AnchorPattern or ShapeNode.AnchorPattern property, and at what point does the application assign to it?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint