예제 #1
0
        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();
        }
예제 #2
0
        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);
        }