Beispiel #1
0
 public SerializerBuilder WithEmissionPhaseObjectGraphVisitor <TObjectGraphVisitor>(WrapperFactory <EmissionPhaseObjectGraphVisitorArgs, IObjectGraphVisitor <IEmitter>, TObjectGraphVisitor> objectGraphVisitorFactory, Action <ITrackingRegistrationLocationSelectionSyntax <IObjectGraphVisitor <IEmitter> > > where) where TObjectGraphVisitor : IObjectGraphVisitor <IEmitter>
 {
     if (objectGraphVisitorFactory == null)
     {
         throw new ArgumentNullException("objectGraphVisitorFactory");
     }
     if (where == null)
     {
         throw new ArgumentNullException("where");
     }
     where (emissionPhaseObjectGraphVisitorFactories.CreateTrackingRegistrationLocationSelector(typeof(TObjectGraphVisitor), (Func <IObjectGraphVisitor <IEmitter>, EmissionPhaseObjectGraphVisitorArgs, IObjectGraphVisitor <IEmitter> >)((IObjectGraphVisitor <IEmitter> wrapped, EmissionPhaseObjectGraphVisitorArgs args) => (IObjectGraphVisitor <IEmitter>)(object) objectGraphVisitorFactory(wrapped, args))));
     return(this);
 }
Beispiel #2
0
 public SerializerBuilder WithPreProcessingPhaseObjectGraphVisitor <TObjectGraphVisitor>(WrapperFactory <IObjectGraphVisitor <Nothing>, TObjectGraphVisitor> objectGraphVisitorFactory, Action <ITrackingRegistrationLocationSelectionSyntax <IObjectGraphVisitor <Nothing> > > where) where TObjectGraphVisitor : IObjectGraphVisitor <Nothing>
 {
     if (objectGraphVisitorFactory == null)
     {
         throw new ArgumentNullException("objectGraphVisitorFactory");
     }
     if (where == null)
     {
         throw new ArgumentNullException("where");
     }
     where (preProcessingPhaseObjectGraphVisitorFactories.CreateTrackingRegistrationLocationSelector(typeof(TObjectGraphVisitor), (Func <IObjectGraphVisitor <Nothing>, IEnumerable <IYamlTypeConverter>, IObjectGraphVisitor <Nothing> >)((IObjectGraphVisitor <Nothing> wrapped, IEnumerable <IYamlTypeConverter> _) => (IObjectGraphVisitor <Nothing>)(object) objectGraphVisitorFactory(wrapped))));
     return(this);
 }
Beispiel #3
0
 public SerializerBuilder WithEventEmitter <TEventEmitter>(WrapperFactory <IEventEmitter, IEventEmitter, TEventEmitter> eventEmitterFactory, Action <ITrackingRegistrationLocationSelectionSyntax <IEventEmitter> > where) where TEventEmitter : IEventEmitter
 {
     if (eventEmitterFactory == null)
     {
         throw new ArgumentNullException("eventEmitterFactory");
     }
     if (where == null)
     {
         throw new ArgumentNullException("where");
     }
     where (eventEmitterFactories.CreateTrackingRegistrationLocationSelector(typeof(TEventEmitter), (Func <IEventEmitter, IEventEmitter, IEventEmitter>)((IEventEmitter wrapped, IEventEmitter inner) => (IEventEmitter)(object)eventEmitterFactory(wrapped, inner))));
     return(((BuilderSkeleton <SerializerBuilder>) this).Self);
 }
 public DeserializerBuilder WithNodeTypeResolver <TNodeTypeResolver>(WrapperFactory <INodeTypeResolver, TNodeTypeResolver> nodeTypeResolverFactory, Action <ITrackingRegistrationLocationSelectionSyntax <INodeTypeResolver> > where) where TNodeTypeResolver : INodeTypeResolver
 {
     if (nodeTypeResolverFactory == null)
     {
         throw new ArgumentNullException("nodeTypeResolverFactory");
     }
     if (where == null)
     {
         throw new ArgumentNullException("where");
     }
     where (nodeTypeResolverFactories.CreateTrackingRegistrationLocationSelector(typeof(TNodeTypeResolver), (Func <INodeTypeResolver, Nothing, INodeTypeResolver>)((INodeTypeResolver wrapped, Nothing _) => (INodeTypeResolver)(object)nodeTypeResolverFactory(wrapped))));
     return(this);
 }
Beispiel #5
0
        /// <summary>
        /// Registers an additional <see cref="INodeDeserializer" /> to be used by the deserializer.
        /// </summary>
        /// <param name="nodeDeserializerFactory">A factory that creates the <see cref="INodeDeserializer" /> based on a previously registered <see cref="INodeDeserializer" />.</param>
        /// <param name="where">Configures the location where to insert the <see cref="INodeDeserializer" /></param>
        public DeserializerBuilder WithNodeDeserializer <TNodeDeserializer>(
            WrapperFactory <INodeDeserializer, TNodeDeserializer> nodeDeserializerFactory,
            Action <ITrackingRegistrationLocationSelectionSyntax <INodeDeserializer> > where
            )
            where TNodeDeserializer : INodeDeserializer
        {
            if (nodeDeserializerFactory == null)
            {
                throw new ArgumentNullException(nameof(nodeDeserializerFactory));
            }

            if (where == null)
            {
                throw new ArgumentNullException(nameof(where));
            }

            where (nodeDeserializerFactories.CreateTrackingRegistrationLocationSelector(typeof(TNodeDeserializer), (wrapped, _) => nodeDeserializerFactory(wrapped)));
            return(this);
        }
        /// <summary>
        /// Registers an additional <see cref="ITypeInspector" /> to be used by the (de)serializer.
        /// </summary>
        /// <param name="typeInspectorFactory">A function that instantiates the type inspector based on a previously registered <see cref="ITypeInspector" />..</param>
        /// <param name="where">Configures the location where to insert the <see cref="ITypeInspector" /></param>
        public TBuilder WithTypeInspector <TTypeInspector>(
            WrapperFactory <ITypeInspector, ITypeInspector, TTypeInspector> typeInspectorFactory,
            Action <ITrackingRegistrationLocationSelectionSyntax <ITypeInspector> > where
            )
            where TTypeInspector : ITypeInspector
        {
            if (typeInspectorFactory == null)
            {
                throw new ArgumentNullException(nameof(typeInspectorFactory));
            }

            if (where == null)
            {
                throw new ArgumentNullException(nameof(where));
            }

            where (typeInspectorFactories.CreateTrackingRegistrationLocationSelector(typeof(TTypeInspector), (wrapped, inner) => typeInspectorFactory(wrapped, inner)));
            return(Self);
        }
        /// <summary>
        /// Registers an additional <see cref="IYamlTypeConverter" /> to be used by the (de)serializer.
        /// </summary>
        /// <param name="typeConverterFactory">A factory that creates the <see cref="IYamlTypeConverter" /> based on a previously registered <see cref="IYamlTypeConverter" />.</param>
        /// <param name="where">Configures the location where to insert the <see cref="IYamlTypeConverter" /></param>
        public TBuilder WithTypeConverter <TYamlTypeConverter>(
            WrapperFactory <IYamlTypeConverter, IYamlTypeConverter> typeConverterFactory,
            Action <ITrackingRegistrationLocationSelectionSyntax <IYamlTypeConverter> > where
            )
            where TYamlTypeConverter : IYamlTypeConverter
        {
            if (typeConverterFactory == null)
            {
                throw new ArgumentNullException(nameof(typeConverterFactory));
            }

            if (where == null)
            {
                throw new ArgumentNullException(nameof(where));
            }

            where (typeConverterFactories.CreateTrackingRegistrationLocationSelector(typeof(TYamlTypeConverter), (wrapped, _) => typeConverterFactory(wrapped)));
            return(Self);
        }