Example #1
0
 public static object LoadObjectFromXml(string path, Type type)
 {
     using (StreamReader reader = new StreamReader(path))
     {
         return(XmlConvertor.XmlToObject(reader.ReadToEnd(), type));
     }
 }
Example #2
0
        public static void SaveObjectToXml(string path, object obj)
        {
            string str = XmlConvertor.ObjectToXml(obj, true);

            using (StreamWriter writer = new StreamWriter(path))
            {
                writer.Write(str);
            }
        }