Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How do i save a single custom node? (Read 1207 times)
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
How do i save a single custom node?
Jul 17th, 2017 at 1:50am
Print Post  
Now I need to store a custom node on my diagram into the database, so I want to serialize the node to save it. However, I did not find a suitable way to save a single custom node. Do you have any good suggestions? I also need to export a single node to jpeg, bmp, dxf and so on.
« Last Edit: Jul 17th, 2017 at 9:29am by chowy »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: How do i save a single custom node?
Reply #1 - Jul 17th, 2017 at 11:28am
Print Post  
You could clone it into a temporary diagram and save / export the latter -

Code
Select All
var tempDiag = new Diagram();
tempDiag.Nodes.Add(node.Clone(false));

var doc = new XmlDocument();
tempDiag.SaveToXml(doc);

var xml = doc.SelectSingleNode("Diagram/Nodes").InnerXml;
Debug.WriteLine(xml);

new PdfExporter().Export(tempDiag, "..."); 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint