Esempio n. 1
0
 public static void LoadQData(string rootPath)
 {
     try {
         var readSettings = new XmlReaderSettings()
         {
             ProhibitDtd     = false,
             CheckCharacters = false,
             CloseInput      = false
         };
         using (var fs = new FileStream(Path.Combine(rootPath, @".\data\quest.xml"),
                                        FileMode.Open, FileAccess.Read))
             using (var reader = XmlReader.Create(fs, readSettings)) {
                 XmlSerializer ser = new XmlSerializer(typeof(QuestsFile));
                 QData = (QuestsFile)ser.Deserialize(reader);
             }
     } catch (Exception ex) {
         Debug.Print(ex.ToString());
     }
 }
Esempio n. 2
0
 public static void LoadQData(string rootPath)
 {
     try {
         var readSettings = new XmlReaderSettings()
         {
             ProhibitDtd = false,
             CheckCharacters = false,
             CloseInput = false
         };
         using (var fs = new FileStream(Path.Combine(rootPath, @".\data\quest.xml"),
                                        FileMode.Open, FileAccess.Read))
         using (var reader = XmlReader.Create(fs, readSettings)) {
             XmlSerializer ser = new XmlSerializer(typeof(QuestsFile));
             QData = (QuestsFile)ser.Deserialize(reader);
         }
     } catch (Exception ex) {
         Debug.Print(ex.ToString());
     }
 }