Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Saving chart to disk (Read 2183 times)
Mark_Wills
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Mar 6th, 2006
Saving chart to disk
Mar 15th, 2006 at 11:57am
Print Post  
Hi there, me again...

I'm working on loading and saving a chart... I can load and save a chart just fine to/from disk, with all design information persisted correctly as one would expect.

However, it looks like the TAG property of my Box objects on the flowchart are not saved... I'm not really surprised, as FlowChart doesn't really know whats in the TAG property.

In my case, each Tag property contains an instance of a very simple class, which holds two Properties of type String. I need to have these saved along with the boxes.

Is there any way I can do this with SaveFile? I see from the help file that XMLWriter can do it, if I have to save the flowchart in XML format that is no problem, but I am having a little trouble understanding how the serialisation works  Embarrassed

Regards

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Saving chart to disk
Reply #1 - Mar 15th, 2006 at 12:00pm
Print Post  
Hi there,

Mark your Tag class with the Serializable attribute. If you don't plan to change it in the future, e.g. add or remove members, that should be enough. Otherwise implement the ISerializable interface, so you can load different versions of the class.

Regards,
Stoyan
  
Back to top
 
IP Logged
 
Mark_Wills
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 27
Joined: Mar 6th, 2006
Re: Saving chart to disk
Reply #2 - Mar 15th, 2006 at 12:25pm
Print Post  
Hi Stoyan,

Yes, that fixed it! This is just too easy  Wink

BTW: I was looking at the XMLWriter help in the online files, and was trying to convert the C# code there to VB.Net, I got as far as this:

Dim myWriter As New MindFusion.FlowChartX.Xml.XmlWrite(myFlowChart)

I was then expecting to do:

myWriter.SerializeTag += New MindFusion.FlowChartX.Xml.SerializeTagEvent(AddressOf myTagEventSerializer)

.... or something like that, however, SerializeTag does not appear in the intellisense...

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Saving chart to disk
Reply #3 - Mar 15th, 2006 at 12:45pm
Print Post  
Hi Mark,

Use the VB.NET AddHandler keyword in place of the C# += operator.

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