Пример #1
0
 public static UpdateFileInfo LoadUpdateFileFromStream(Stream xmlStream)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(UpdateFileInfo));
     XmlTextReader xmlTextReader = new XmlTextReader(xmlStream);
     _updateFile = (UpdateFileInfo)serializer.Deserialize(xmlTextReader);
     return _updateFile;
 }
Пример #2
0
 public static UpdateFileInfo LoadUpdateFile(string fileName)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(UpdateFileInfo));
     XmlTextReader xmlTextReader = new XmlTextReader(fileName);
     _updateFile = (UpdateFileInfo)serializer.Deserialize(xmlTextReader);
     return _updateFile;
 }
Пример #3
0
 public static void SaveUpdateFile(string fileName, UpdateFileInfo updateFile)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(UpdateFileInfo));
     using (FileStream writer = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
     {
         serializer.Serialize(writer, updateFile);
     }
 }
Пример #4
0
        public static UpdateFileInfo LoadUpdateFileFromStream(Stream xmlStream)
        {
            XmlSerializer serializer    = new XmlSerializer(typeof(UpdateFileInfo));
            XmlTextReader xmlTextReader = new XmlTextReader(xmlStream);

            _updateFile = (UpdateFileInfo)serializer.Deserialize(xmlTextReader);
            return(_updateFile);
        }
Пример #5
0
        public static UpdateFileInfo LoadUpdateFile(string fileName)
        {
            XmlSerializer serializer    = new XmlSerializer(typeof(UpdateFileInfo));
            XmlTextReader xmlTextReader = new XmlTextReader(fileName);

            _updateFile = (UpdateFileInfo)serializer.Deserialize(xmlTextReader);
            return(_updateFile);
        }
Пример #6
0
        public static void SaveUpdateFile(string fileName, UpdateFileInfo updateFile)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(UpdateFileInfo));

            using (FileStream writer = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
            {
                serializer.Serialize(writer, updateFile);
            }
        }