示例#1
0
        public static object XmlDeserialize(Type type, string xml)
        {
            var xmlFormatter = new XmlFormatter(type);
            var graph        = xmlFormatter.Deserialize(xml);

            return(graph);
        }
示例#2
0
        public static string XmlSerialize(object graph)
        {
            var xmlFormatter = new XmlFormatter(graph.GetType());
            var xml          = xmlFormatter.Serialize(graph);

            return(xml);
        }