private void XmlSerialization(string filename, GUIControlProperties obj) { //Create a file stream object FileStream serializeStream = File.Create(filename); //Start Serialization XmlSerializer xmlFmt = new XmlSerializer(obj.GetType()); xmlFmt.Serialize(serializeStream, obj); serializeStream.Close(); }
private GUIControlProperties XmlDeSerialization(string filename) { GUIControlProperties GuiCtrlProp = new GUIControlProperties(); //Create a file stream object FileStream serializeStream = File.OpenRead(filename); //Start Serialization XmlSerializer xmlFmt = new XmlSerializer(GuiCtrlProp.GetType()); GuiCtrlProp = (GUIControlProperties)xmlFmt.Deserialize(serializeStream); serializeStream.Close(); return(GuiCtrlProp); }