Exemple #1
0
        public DotNetSerializableCodec(
            IFieldCodec <Type> typeCodec,
            IFieldCodec <string> stringCodec,
            IFieldCodec <object> objectCodec,
            IUntypedCodecProvider untypedCodecProvider)
        {
            this.typeCodec            = typeCodec;
            this.untypedCodecProvider = untypedCodecProvider;
            var entrySerializer        = new SerializationEntryCodec(stringCodec, objectCodec);
            var constructorFactory     = new SerializationConstructorFactory();
            var serializationCallbacks = new SerializationCallbacksFactory();
            var formatterConverter     = new FormatterConverter();

            this.objectSerializer = new ObjectSerializer(
                entrySerializer,
                constructorFactory,
                serializationCallbacks,
                formatterConverter,
                this.streamingContext);

            this.valueTypeSerializerFactory = new ValueTypeSerializerFactory(
                entrySerializer,
                constructorFactory,
                serializationCallbacks,
                formatterConverter,
                this.streamingContext);
        }
Exemple #2
0
        public DotNetSerializableCodec(
            IFieldCodec <Type> typeCodec)
        {
            this.typeCodec = typeCodec;
            var entrySerializer        = new SerializationEntryCodec();
            var constructorFactory     = new SerializationConstructorFactory();
            var serializationCallbacks = new SerializationCallbacksFactory();
            var formatterConverter     = new FormatterConverter();

            this.objectSerializer = new ObjectSerializer(
                entrySerializer,
                constructorFactory,
                serializationCallbacks,
                formatterConverter,
                this.streamingContext);

            this.valueTypeSerializerFactory = new ValueTypeSerializerFactory(
                entrySerializer,
                constructorFactory,
                serializationCallbacks,
                formatterConverter,
                this.streamingContext);
        }