Пример #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);
        }
Пример #2
0
 public ObjectSerializer(
     SerializationEntryCodec entrySerializer,
     SerializationConstructorFactory constructorFactory,
     SerializationCallbacksFactory serializationCallbacks,
     IFormatterConverter formatterConverter,
     StreamingContext streamingContext)
 {
     this.serializationCallbacks    = serializationCallbacks;
     this.formatterConverter        = formatterConverter;
     this.streamingContext          = streamingContext;
     this.entrySerializer           = entrySerializer;
     this.createConstructorDelegate = constructorFactory.GetSerializationConstructorDelegate;
 }
Пример #3
0
 public ValueTypeSerializerFactory(
     SerializationEntryCodec entrySerializer,
     SerializationConstructorFactory constructorFactory,
     SerializationCallbacksFactory callbacksFactory,
     IFormatterConverter formatterConverter,
     StreamingContext streamingContext)
 {
     _constructorFactory       = constructorFactory;
     _callbacksFactory         = callbacksFactory;
     _entrySerializer          = entrySerializer;
     _streamingContext         = streamingContext;
     _formatterConverter       = formatterConverter;
     _createSerializerDelegate = type => (ISerializableSerializer)_createTypedSerializerMethodInfo.MakeGenericMethod(type).Invoke(this, null);
 }
Пример #4
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);
        }