Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Saving and Retrieving a diagram to/from the database (Read 1157 times)
dhaval
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Nov 15th, 2012
Saving and Retrieving a diagram to/from the database
Dec 6th, 2012 at 4:36am
Print Post  
I have a diagram where a user can add couple of composite nodes and have one or multiple link to/from each node. After adding the nodes, the user can rearrange the diagram by dragging nodes and links.

II want o retain the state of this diagram in the database. And when the user loads the screen again, I want to draw to diagram as it was previously arranged, what are the properties I need to serialize and save? All nodes are of same size so I do not need to save the width and height. Other than these, what can I save to persist the arrangement of nodes and links.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Saving and Retrieving a diagram to/from the database
Reply #1 - Dec 6th, 2012 at 6:38am
Print Post  
You could use the SaveToString and LoadFromString methods to store the whole diagram in a single text field.

If you prefer creating records for each diagram item, check the code here:
http://mindfusion.eu/Forum/YaBB.pl?num=1352535946/1#1

You must save Bounds for nodes and ControlPoints for link in order to preserve their positions.

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