Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need example on how to override SaveToXml (Read 1203 times)
marksolo
YaBB Newbies
*
Offline


Suffering suckertash.....
..

Posts: 18
Joined: Nov 26th, 2008
Need example on how to override SaveToXml
Dec 23rd, 2008 at 6:32pm
Print Post  

Hello,

Can any one give me an example on how to override the SaveToXml method when you derive a class from the ShapeNode class?

Thanks,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need example on how to override SaveToXml
Reply #1 - Dec 23rd, 2008 at 7:07pm
Print Post  
Hi,

E.g. you could add this to the IconNodes sample to enable XML serialization:

Code
Select All
protected override void SaveToXml(System.Xml.XmlElement xmlElement, XmlPersistContext context)
{
	base.SaveToXml(xmlElement, context);

	context.WriteString(label, "Label", xmlElement);
	context.WriteImage(icon, "Icon", xmlElement);
}
 



You must also call the RegisterItemClass as shown in IconNodes.

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