Example #1
0
 public XmlSerializationOptions(
     XmlSerializerNamespaces namespaces = null,
     Encoding encoding              = null,
     bool shouldEncryptRootObject   = false,
     string defaultNamespace        = null,
     bool shouldIndent              = false,
     string rootElementName         = null,
     bool shouldAlwaysEmitTypes     = false,
     bool shouldRedact              = true,
     bool shouldEncrypt             = true,
     bool treatEmptyElementAsString = false,
     bool emitNil = false,
     IEncryptionMechanism encryptionMechanism = null,
     object encryptKey            = null,
     bool ShouldIgnoreCaseForEnum = false)
 {
     _namespaces = namespaces ?? new XmlSerializerNamespaces();
     _encoding   = encoding ?? Encoding.UTF8;
     _shouldEncryptRootObject = shouldEncryptRootObject;
     _defaultNamespace        = defaultNamespace;
     _shouldIndent            = shouldIndent;
     _rootElementName         = rootElementName;
     _shouldAlwaysEmitTypes   = shouldAlwaysEmitTypes;
     _shouldRedact            = shouldRedact;
     _shouldEncrypt           = shouldEncrypt;
     _extraTypes = null;
     _treatEmptyElementAsString = treatEmptyElementAsString;
     _emitNil                 = emitNil;
     _encryptionMechanism     = encryptionMechanism;
     _encryptKey              = encryptKey;
     _shouldIgnoreCaseForEnum = ShouldIgnoreCaseForEnum;
 }
 public XmlSerializationOptions(
     XmlSerializerNamespaces namespaces = null,
     Encoding encoding = null,
     bool shouldEncryptRootObject = false,
     string defaultNamespace = null,
     bool shouldIndent = false,
     string rootElementName = null,
     bool shouldAlwaysEmitTypes = false,
     bool shouldRedact = true,
     bool shouldEncrypt = true,
     bool treatEmptyElementAsString = false,
     bool emitNil = false,
     IEncryptionMechanism encryptionMechanism = null,
     object encryptKey = null,
     bool ShouldIgnoreCaseForEnum = false)
 {
     _namespaces = namespaces ?? new XmlSerializerNamespaces();
     _encoding = encoding ?? Encoding.UTF8;
     _shouldEncryptRootObject = shouldEncryptRootObject;
     _defaultNamespace = defaultNamespace;
     _shouldIndent = shouldIndent;
     _rootElementName = rootElementName;
     _shouldAlwaysEmitTypes = shouldAlwaysEmitTypes;
     _shouldRedact = shouldRedact;
     _shouldEncrypt = shouldEncrypt;
     _extraTypes = null;
     _treatEmptyElementAsString = treatEmptyElementAsString;
     _emitNil = emitNil;
     _encryptionMechanism = encryptionMechanism;
     _encryptKey = encryptKey;
     _shouldIgnoreCaseForEnum = ShouldIgnoreCaseForEnum;
 }
 public EncryptingTextWriter(TextWriter writer, IEncryptionMechanism encryptionMechanism, object encryptKey, SerializationState serializationState)
 {
     _writer = writer;
     _encryptionMechanism = encryptionMechanism;
     _encryptKey          = encryptKey;
     _serializationState  = serializationState;
 }
        public XSerializerXmlReader(XmlReader reader, IEncryptionMechanism encryptionMechanism, object encryptKey, SerializationState serializationState)
        {
            _primaryReader = reader;
            _currentReader = reader;

            _encryptionMechanism = encryptionMechanism;
            _encryptKey = encryptKey;
            _serializationState = serializationState;
        }
        public XSerializerXmlReader(XmlReader reader, IEncryptionMechanism encryptionMechanism, object encryptKey, SerializationState serializationState)
        {
            _primaryReader = reader;
            _currentReader = reader;

            _encryptionMechanism = encryptionMechanism;
            _encryptKey          = encryptKey;
            _serializationState  = serializationState;
        }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonObject"/> class.
 /// </summary>
 /// <param name="dateTimeHandler">The object that determines how date time values are parsed.</param>
 /// <param name="encryptionMechanism">The object the performs encryption operations.</param>
 /// <param name="encryptKey">A key optionally used by the encryption mechanism during encryption operations.</param>
 /// <param name="serializationState">An object optionally used by the encryption mechanism to carry state across multiple encryption operations.</param>
 public JsonObject(
     IDateTimeHandler dateTimeHandler         = null,
     IEncryptionMechanism encryptionMechanism = null,
     object encryptKey = null,
     SerializationState serializationState = null)
     : this(new JsonSerializeOperationInfo
 {
     DateTimeHandler = dateTimeHandler ?? DateTimeHandler.Default,
     EncryptionMechanism = encryptionMechanism,
     EncryptKey = encryptKey,
     SerializationState = serializationState
 })
 {
 }
 public XmlSerializationOptions(
     XmlSerializerNamespaces namespaces,
     Encoding encoding,
     bool shouldEncryptRootObject,
     string defaultNamespace,
     bool shouldIndent,
     string rootElementName,
     bool shouldAlwaysEmitTypes,
     bool shouldRedact,
     bool shouldEncrypt,
     bool treatEmptyElementAsString,
     bool emitNil,
     IEncryptionMechanism encryptionMechanism,
     object encryptKey,
     bool shouldIgnoreCaseForEnum,
     bool shouldSerializeCharAsInt)
     : this(namespaces, encoding, shouldEncryptRootObject, defaultNamespace,
            shouldIndent, rootElementName, shouldAlwaysEmitTypes, shouldRedact,
            shouldEncrypt, treatEmptyElementAsString, emitNil, encryptionMechanism,
            encryptKey, shouldIgnoreCaseForEnum, shouldSerializeCharAsInt, false)
 {
 }
Example #8
0
 public XmlSerializationOptions(
     XmlSerializerNamespaces namespaces = null,
     Encoding encoding              = null,
     bool shouldEncryptRootObject   = false,
     string defaultNamespace        = null,
     bool shouldIndent              = false,
     string rootElementName         = null,
     bool shouldAlwaysEmitTypes     = false,
     bool shouldRedact              = true,
     bool shouldEncrypt             = true,
     bool treatEmptyElementAsString = false,
     bool emitNil = false,
     IEncryptionMechanism encryptionMechanism = null,
     object encryptKey                         = null,
     bool shouldIgnoreCaseForEnum              = false,
     bool shouldSerializeCharAsInt             = false,
     bool shouldUseAttributeDefinedInInterface = false,
     CultureInfo culture                       = null)
 {
     _namespaces = namespaces ?? new XmlSerializerNamespaces();
     _encoding   = encoding ?? Encoding.UTF8;
     _shouldEncryptRootObject = shouldEncryptRootObject;
     _defaultNamespace        = defaultNamespace;
     _shouldIndent            = shouldIndent;
     _rootElementName         = rootElementName;
     _shouldAlwaysEmitTypes   = shouldAlwaysEmitTypes;
     _shouldRedact            = shouldRedact;
     _shouldEncrypt           = shouldEncrypt;
     _extraTypes = null;
     _treatEmptyElementAsString = treatEmptyElementAsString;
     _emitNil                              = emitNil;
     _encryptionMechanism                  = encryptionMechanism;
     _encryptKey                           = encryptKey;
     _shouldIgnoreCaseForEnum              = shouldIgnoreCaseForEnum;
     _shouldSerializeCharAsInt             = shouldSerializeCharAsInt;
     _shouldUseAttributeDefinedInInterface = shouldUseAttributeDefinedInInterface;
     _culture                              = culture ?? CultureInfo.InvariantCulture;
 }
 public XmlSerializationOptions WithEncryptionMechanism(IEncryptionMechanism encryptionMechanism)
 {
     _encryptionMechanism = encryptionMechanism;
     return this;
 }
 private XSerializerXmlReader(string xml, IEncryptionMechanism encryptionMechanism, object encryptKey, SerializationState serializationState)
     : this(new XmlTextReader(new StringReader(xml)), encryptionMechanism, encryptKey, serializationState)
 {
 }
 public void Setup()
 {
     _current = EncryptionMechanism.Current;
     _myEncryptionMechanism = new MyEncryptionMechanism();
     EncryptionMechanism.Current = _myEncryptionMechanism;
 }
 public EncryptingTextWriter(TextWriter writer, IEncryptionMechanism encryptionMechanism, object encryptKey, SerializationState serializationState)
 {
     _writer = writer;
     _encryptionMechanism = encryptionMechanism;
     _encryptKey = encryptKey;
     _serializationState = serializationState;
 }
Example #13
0
 public XmlSerializationOptions WithEncryptionMechanism(IEncryptionMechanism encryptionMechanism)
 {
     _encryptionMechanism = encryptionMechanism;
     return(this);
 }
 private XSerializerXmlReader(string xml, IEncryptionMechanism encryptionMechanism, object encryptKey, SerializationState serializationState)
     : this(new XmlTextReader(new StringReader(xml)), encryptionMechanism, encryptKey, serializationState)
 {
 }
 public void Setup()
 {
     _current = EncryptionMechanism.Current;
     _myEncryptionMechanism      = new MyEncryptionMechanism();
     EncryptionMechanism.Current = _myEncryptionMechanism;
 }