Пример #1
0
        public static LayerSchema FromXML(string xmlFile)
        {
            LayerSchema  szkic  = null;
            StreamReader reader = null;

            try
            {
                XmlSerializer xmlSer = new XmlSerializer(typeof(LayerSchema));
                reader = new StreamReader(xmlFile);
                szkic  = (LayerSchema)xmlSer.Deserialize(reader);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return(szkic);
        }
Пример #2
0
        public static void ToXML(string xmlFile, LayerSchema model)
        {
            XmlSerializer xmlSer = new XmlSerializer(typeof(LayerSchema));
            StreamWriter  writer = new StreamWriter(xmlFile);

            xmlSer.Serialize(writer, model);
            writer.Close();
        }
Пример #3
0
 public void ToXML(string xmlFile)
 {
     LayerSchema.ToXML(xmlFile, this);
 }