Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Help! Save a flowchart to file with boxes with tag (Read 1759 times)
marc_feuerstein
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Mar 29th, 2006
Help! Save a flowchart to file with boxes with tag
Mar 29th, 2006 at 8:31am
Print Post  
Hey there,
I have created a flowchart where the boxes have the Tag attribute set to a custom class called nodeProperties.

I do call the FlowChart1.SaveToFile("c:\myFileName") without any problems.

But ... when I execute FlowChart1.LoadFromFile("c:\myFileName") , I have an error message.

I do NOT have this problem when the tag property of my boxes are not assigned...

What should I do to ensure that a flowchart containing boxes with tags gets saved and loaded correctly (including the tags) ?

Has it something to do with serialization ?

If you would give me some mini code example, it would save me !

Thanks to help me out.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Help! Save a flowchart to file with boxes with
Reply #1 - Mar 29th, 2006 at 10:30am
Print Post  
Hi there,

You could take a look at the SiteMap example - it uses PageProps objects as box tags. The trick is to mark the class with the [Serializable] attribute so .NET implements serialization for you. There is a catch - if you intend to change the format of the properties' class or add/remove properties in future versions, you might have to implement the ISerializale interface in your class and write a version id with each tag. So when loading files that contain Tags of an old format, you can still load the tags by checking the version id and load only the fields that existed in that version.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
marc_feuerstein
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Mar 29th, 2006
Re: Help! Save a flowchart to file with boxes with
Reply #2 - Mar 29th, 2006 at 11:10am
Print Post  
Hello,
it worked perfectly ! Many thanks !

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