Пример #1
0
 public static void LoadClientGatherables(string root)
 {
     try {
         using (var fs = new FileStream(Path.Combine(root, @".\data\gather_src.xml"),
                                        FileMode.Open, FileAccess.Read))
             using (var reader = XmlReader.Create(fs)) {
                 XmlSerializer ser = new XmlSerializer(typeof(ClientGatherSrc));
                 ser.UnknownElement += new XmlElementEventHandler(delegate(object sender, XmlElementEventArgs e)
                 {
                     Debug.Print("Unknown element: '{0}' (line: {1})", e.Element.Name, e.LineNumber);
                 });
                 GatherSrcFile = (ClientGatherSrc)ser.Deserialize(reader);
                 GatherSrcFile.CreateIndex();
             }
     } catch (Exception ex) {
         Debug.Print(ex.ToString());
     }
 }
Пример #2
0
 public static void LoadClientGatherables(string root)
 {
     try {
         using (var fs = new FileStream(Path.Combine(root, @".\data\gather_src.xml"),
                                        FileMode.Open, FileAccess.Read))
         using (var reader = XmlReader.Create(fs)) {
             XmlSerializer ser = new XmlSerializer(typeof(ClientGatherSrc));
             ser.UnknownElement += new XmlElementEventHandler(delegate(object sender, XmlElementEventArgs e)
             {
                 Debug.Print("Unknown element: '{0}' (line: {1})", e.Element.Name, e.LineNumber);
             });
             GatherSrcFile = (ClientGatherSrc)ser.Deserialize(reader);
             GatherSrcFile.CreateIndex();
         }
     } catch (Exception ex) {
         Debug.Print(ex.ToString());
     }
 }