Exemplo n.º 1
0
 public WireSerialization(
     ILogFactory logFactory,
     GenericDeserializationBinder binder)
 {
     Xml      = new XmlSerialization(null, null, binder, logFactory);
     Json     = new JsonSerialization(binder, logFactory);
     Protobuf = new ProtobufSerialization();
     Pass     = new PassThroughSerialization();
 }
Exemplo n.º 2
0
        public JsonSerialization(
            GenericDeserializationBinder binder,
            ILogFactory logFactory)
        {
            Contract.Requires(binder != null);
            Contract.Requires(logFactory != null);

            this.Binder      = binder;
            this.Logger      = logFactory.Create(GetType().FullName);
            SharedSerializer = new JsonSerializer();
            SharedSerializer.Converters.Add(new StringEnumConverter());
            SharedSerializer.TypeNameHandling       = TypeNameHandling.Auto;
            SharedSerializer.TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple;
            SharedSerializer.Binder = binder;
        }
Exemplo n.º 3
0
        public XmlSerialization(
            ITypeResolver typeResolver,
            GenericDataContractResolver genericResolver,
            GenericDeserializationBinder genericBinder,
            ILogFactory logFactory)
        {
            Contract.Requires(typeResolver != null);
            Contract.Requires(genericResolver != null);
            Contract.Requires(genericBinder != null);
            Contract.Requires(logFactory != null);

            this.TypeResolver    = typeResolver;
            this.GenericResolver = genericResolver;
            this.GenericBinder   = genericBinder;
            this.Logger          = logFactory.Create(GetType().FullName);
        }