Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Links intersection display when handle is close to crossing (Read 2783 times)
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 86
Joined: Aug 25th, 2022
Re: Links intersection display when handle is close to crossing
Reply #15 - May 11th, 2023 at 6:36am
Print Post  
Attempt №2
  

AppBug.mp4 ( 470 KB | 33 Downloads )
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Links intersection display when handle is close to crossing
Reply #16 - May 15th, 2023 at 9:21am
Print Post  
Quote:
but the classes have too many domain properties and it is impossible to make all of them serializable


Domain properties shouldn't be related to position of crossing decorations. Please only register the classes (without overriding serialization methods) and attach the xml file, so we can trace this with your node and link coordinates.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 86
Joined: Aug 25th, 2022
Re: Links intersection display when handle is close to crossing
Reply #17 - May 16th, 2023 at 6:00am
Print Post  
I do register only classes, but face a problem when I need to mark many classes as serializable, because they are being used as property in that classes. Maybe you could recommend any ignore attribute for these properties?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Links intersection display when handle is close to crossing
Reply #18 - May 16th, 2023 at 6:48am
Print Post  
We do not need to see values of you custom properties for derived node types, but only node and link coordinates from SaveToXml result. It should be enough to register the custom DiagramItem type, without overriding its serialization methods to handle the added properties. Custom types might matter if you assign their instances to Tag or Id properties. In such case try handling SerializeTag event and just set args.Handled = true.

Alternatively, export coordinates in some simple format as below. Restoring the diagram from that should still show your link crossing positions for our developer to inspect:

Code
Select All
var writer = new StreamWriter("diagram.txt");
writer.WriteLine(diagram.Nodes.Count);
foreach (var node in diagram.Nodes)
{
	writer.WriteLine(node.Bounds);
}
writer.WriteLine(diagram.Links.Count);
foreach (var link in diagram.Links)
{
	var orgIndex = diagram.Nodes.IndexOf(link.Origin);
	var dstIndex = diagram.Nodes.IndexOf(link.Destination);
	writer.Write("{0} {1} {2} {3} ",
		orgIndex, dstIndex, (int)link.Shape, link.ControlPoints.Count);
	foreach (var point in link.ControlPoints)
	{
		writer.Write(point);
		writer.Write(" ");
	}
	writer.WriteLine();
}
writer.Close(); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 86
Joined: Aug 25th, 2022
Re: Links intersection display when handle is close to crossing
Reply #19 - May 17th, 2023 at 5:35am
Print Post  
I do understand that you don't need to see my domain properties. But the trick is that I simply can't export the diagram having it. I get the following exception
Code
Select All
System.Runtime.Serialization.SerializationException: 'Type 'DomainClass' in Assembly 'Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.'
 


But anyway, if you are okay with the text coordinates, I've imported it successfully.
  

diagram.txt ( 0 KB | 38 Downloads )
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Links intersection display when handle is close to crossing
Reply #20 - May 18th, 2023 at 2:08pm
Print Post  
It should try using Serializable only if those classes are used as (part of) Tag or Id values, and you can skip them by handling SerializeTag event.

The problem with missed decoration was that points are not collinear, with small difference in Y coordinates. This build give them a couple of pixels leeway -

https://mindfusion.eu/_beta/wpfdiag393.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 86
Joined: Aug 25th, 2022
Re: Links intersection display when handle is close to crossing
Reply #21 - May 19th, 2023 at 5:10am
Print Post  
It is working as expected. Thank You! Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint