Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic To SaveToStream or Not To (Read 2533 times)
Aaron
Guest


To SaveToStream or Not To
Apr 21st, 2006 at 8:50pm
Print Post  
In your opinion is it better to save the structure of the diagram with SaveToStream, then later reload the diagram with LoadFromStream.....OR is it better to store the individual properties of each object in a databse then rebuild through ADO.NET?

If I sub-classed the BOX class and added some properties will those properties be restored after LoadingFromStream is finished?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To SaveToStream or Not To
Reply #1 - Apr 24th, 2006 at 7:51am
Print Post  
If you do not need to read the properties of flowchart items directly from the database, then by all means use SaveToStream, it will much easier than implementing database input/output yourself. By the way we are going to add intrinsic support for data binding in the following month, so you might wait for that version if you don't need it urgently.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To SaveToStream or Not To
Reply #2 - Apr 24th, 2006 at 7:53am
Print Post  
You can use the box.Tag to store your additional properties there. They will be saved and loaded automatically, as long as your tag class supports the .NET ISerializable interface.
  
Back to top
 
IP Logged
 
FusionUser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Apr 4th, 2006
Re: To SaveToStream or Not To
Reply #3 - Apr 27th, 2006 at 4:59pm
Print Post  
Stoyo,

Is it possible just to save the size of the chart and the location of each tables in the chart in to a file and when i open the file back up and to recreate the chart with the saved size and then create each table and move the tables to the previously saved location.   I am sure it should be possible.  Do you know which properties and functions should I be using?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: To SaveToStream or Not To
Reply #4 - Apr 27th, 2006 at 5:43pm
Print Post  
If you need to save only the location of tables, then use their BoundingRect property to find out the table coordinates. You can restore the location of a table by assigning to its BoundingRect:

aTable.BoundingRect = new RectangleF(x, y, w, h);

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint