LS
Lori S. Pearsall
July 6, 2004 02:14 PM UTC
Let''s try this again - code sample :
MemoryStream strOutput = new MemoryStream();
System.Xml.XmlTextWriter writer = new XmlTextWriter(strOutput, null);
this.BackgroundColor = new BrushInfo(Color.Purple);
this.BackgroundColor.WriteXml(writer);
What am I missing??
AD
Administrator
Syncfusion Team
July 7, 2004 02:49 PM UTC
Hi Lori
You could use the XmlSerializer Class to do what you are seeking. Here is a code snippet which saves the information in a file called bginfo.xml:
string xmlFilename = "bginfo.xml";
XmlSerializer serializer = new XmlSerializer(typeof(Syncfusion.Drawing.BrushInfo));
Stream fs = new FileStream(xmlFilename, FileMode.Create);
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(fs, System.Text.Encoding.Default);
serializer.Serialize(fs,this.gradientPanel1.BackgroundColor);
writer.Close();
Regards,
Arun