Beispiel #1
0
 public static void Serialize(XmlWriter xWrite, Mob contents)
 {
     XmlSerializer Writer = new XmlSerializer(contents.GetType());
     XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
     ns.Add("", "http://www.hybrasyl.com/XML/Creatures");
     Writer.Serialize(xWrite, contents, ns);
 }
Beispiel #2
0
 public static Mob Deserialize(XmlReader reader, Mob contents = null)
 {
     //reader.Settings.IgnoreWhitespace = false;
     if (contents == null) contents = new Mob();
     XmlSerializer XmlSerial = new XmlSerializer(contents.GetType());
     if (XmlSerial.CanDeserialize(reader))
     {
         var xContents = XmlSerial.Deserialize(reader);
         contents = (Mob)xContents;
     }
     return contents;
 }