Example #1
0
        public static object DeserializeObject(this IXmlSerializerInternal serializer, TextReader textReader, ISerializeOptions options)
        {
            options = options.WithNewSerializationState();

            var xmlReader = new XmlTextReader(textReader);
            var reader    = new XSerializerXmlReader(xmlReader, options.GetEncryptionMechanism(), options.EncryptKey, options.SerializationState);

            return(serializer.DeserializeObject(reader, options));
        }
Example #2
0
        public static object DeserializeObject(this IXmlSerializerInternal serializer, string xml, ISerializeOptions options)
        {
            options = options.WithNewSerializationState();

            using (var stringReader = new StringReader(xml))
            {
                using (var xmlReader = new XmlTextReader(stringReader))
                {
                    using (var reader = new XSerializerXmlReader(xmlReader, options.GetEncryptionMechanism(), options.EncryptKey, options.SerializationState))
                    {
                        return(serializer.DeserializeObject(reader, options));
                    }
                }
            }
        }
 public XSerializerXmlTextWriter(TextWriter writer, ISerializeOptions options)
     : this(new EncryptingTextWriter(writer, options.GetEncryptionMechanism(), options.EncryptKey, options.SerializationState), options)
 {
 }
 public XSerializerXmlTextWriter(TextWriter writer, ISerializeOptions options)
     : this(new EncryptingTextWriter(writer, options.GetEncryptionMechanism(), options.EncryptKey, options.SerializationState), options)
 {
 }