Beispiel #1
0
        protected object DeserializeTo(string objectData, Type type, ReadWriteAttributes attr)
        {
            var serializer = new XmlSerializer(type, attr);
            var result     = string.Empty;

            using (var reader = new StringReader(objectData))
                return(serializer.Deserialize(reader));
        }
Beispiel #2
0
        protected string SerializeFrom(object objectData, Type type, ReadWriteAttributes attr)
        {
            var serializer = new XmlSerializer(type, attr);

            using (var writer = new StringWriter())
            {
                serializer.Serialize(writer, objectData);
                return(writer.ToString());
            }
        }
Beispiel #3
0
 protected internal T XmlDeserializeTo <T>(string objectData, ReadWriteAttributes attr)
 => (T)DeserializeTo(objectData, typeof(T), attr);
Beispiel #4
0
 protected internal string XmlSerializeFrom <T>(T objectData, ReadWriteAttributes attr)
 => SerializeFrom(objectData, typeof(T), attr);