public ObjectSerializer(
     SerializationConstructorFactory constructorFactory,
     SerializationCallbacksFactory serializationCallbacks,
     IFormatterConverter formatterConverter)
 {
     _constructorFactory     = constructorFactory;
     _serializationCallbacks = serializationCallbacks;
     _formatterConverter     = formatterConverter;
 }
 public ValueTypeSerializerFactory(
     SerializationConstructorFactory constructorFactory,
     SerializationCallbacksFactory callbacksFactory,
     IFormatterConverter formatterConverter)
 {
     _constructorFactory       = constructorFactory;
     _callbacksFactory         = callbacksFactory;
     _formatterConverter       = formatterConverter;
     _createSerializerDelegate = type => (ValueTypeSerializer)
                                 _createTypedSerializerMethodInfo.MakeGenericMethod(type).Invoke(this, null);
 }
Example #3
0
        public ExceptionCodec(
            IServiceProvider serviceProvider,
            TypeConverter typeConverter,
            IFieldCodec <Dictionary <object, object> > dictionaryCodec,
            IDeepCopier <Dictionary <object, object> > dictionaryCopier,
            IDeepCopier <Exception> exceptionCopier)
        {
            _streamingContext   = new StreamingContext(StreamingContextStates.All);
            _formatterConverter = new FormatterConverter();
            var constructorFactory = new SerializationConstructorFactory();

            _createConstructorDelegate = constructorFactory.GetSerializationConstructorDelegate;
            _baseExceptionConstructor  = _createConstructorDelegate(typeof(Exception));
            _serviceProvider           = serviceProvider;
            _typeConverter             = typeConverter;
            _dictionaryCodec           = dictionaryCodec;
            _dictionaryCopier          = dictionaryCopier;
            _exceptionCopier           = exceptionCopier;
        }