Exemplo n.º 1
0
 public string WriteObject(object o)
 {
     Xml.XmlDoc        doc         = new Utils.Xml.XmlDoc();
     Xml.XmlDocElement dataElement = doc["Data"];
     _defaultTypeSerializer.WriteObject(o, dataElement, null);
     return(doc.ToString());
 }
Exemplo n.º 2
0
 public Xml.XmlDoc WriteObjectToXmlDoc(object o)
 {
     Xml.XmlDoc doc = new Utils.Xml.XmlDoc();
     doc.AddXmlDeclaration("1.0", "utf-8", null);
     Xml.XmlDocElement rootElement = doc["XMLSerializer"];
     Xml.XmlDocElement dataElement = rootElement["Data"];
     _defaultTypeSerializer.WriteObject(o, dataElement, null);
     return(doc);
 }
Exemplo n.º 3
0
        public object ReadObjectFromFile(string filename)
        {
            if (!File.Exists(filename))
            {
                return(null);
            }
            Xml.XmlDoc        doc         = new Utils.Xml.XmlDoc(filename);
            Xml.XmlDocElement rootElement = doc["XMLSerializer"];
            Xml.XmlDocElement dataElement = rootElement["Data"];
            object            result      = null;

            _defaultTypeSerializer.ReadObject(ref result, dataElement, null);
            return(result);
        }