- Welcome, Guest. Please Login or Register
MindFusion  
  Version 2 of our Xamarin Calendar component adds Resource view and support for Universal Windows Platform. Now beta testing UWP version of Xamarin Diagram.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
How do i save a single custom node?
Read 96 times

chowy   Offline
Junior Member
**
Posts: 55
I Love MindFusion!


   
     
 
How do i save a single custom node?
Jul 17th, 2017 at 2:50am
 
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 10:29am by chowy »
 
IP Logged    
 
     

Slavcho   Online
God Member
*****
Posts: 1245
Gender: male
tech.support


   
     
 
Re: How do i save a single custom node?
Reply #1 - Jul 17th, 2017 at 12:28pm
 
You could clone it into a temporary diagram and save / export the latter -

Code:
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
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print