// ReSharper disable once TooManyDependencies /// <summary> /// Initializes a new instance of the <see cref="T:ExtendedXmlSerializer.ExtensionModel.Content.Members.MemberPropertiesExtension"/> class. /// </summary> /// <param name="names">The names.</param> /// <param name="order">The order.</param> /// <param name="defaultNames">The default names.</param> /// <param name="defaultMemberOrder">The default member order.</param> public MemberPropertiesExtension(IDictionary <MemberInfo, string> names, IDictionary <MemberInfo, int> order, INames defaultNames, IParameterizedSource <MemberInfo, int> defaultMemberOrder) { _defaultNames = defaultNames; _defaultMemberOrder = defaultMemberOrder; Order = order; Names = names; }
public Source(IAllowedValueSpecification allowed, IGeneric <ISpecification <object>, ISpecification <object> > generic, IParameterizedSource <TypeInfo, TypeInfo> type) { _allowed = allowed; _generic = generic; _type = type; }
public static ImmutableArray <TItem>?GetAny <T, TItem>(this IParameterizedSource <T, ImmutableArray <TItem> > @this, T parameter) { var items = @this.Get(parameter); var result = items.Any() ? items : (ImmutableArray <TItem>?)null; return(result); }
protected GenericAdapterBase(Type definition, IParameterizedSource <TypeInfo, T> source) : base( new SelectCoercer <TypeInfo, Type>(TypeCoercer.Default.ToDelegate()) .To(new GenericTypeAlteration(definition)) .To(TypeMetadataCoercer.Default) .To(source) ) { }
public ListSerializer(ISerializer serializer, ISerializers serializers, IMemberSerializer @default, IMemberSerializer item, IIdentity identity, ILists lists, TypeInfo type) { _serializer = serializer; _serializers = serializers; _default = @default; _item = item; _identity = identity; _lists = lists; _type = type; }
IAllowedMemberValues Register(IServiceProvider arg) { IParameterizedSource <MemberInfo, IAllowedValueSpecification> seed = new Seeding(Specifications, Instances, _allowed).Get(), fallback = _allowed == AllowAssignedValues ? Source.Default : new FixedInstanceSource <MemberInfo, IAllowedValueSpecification>(_allowed); var source = this.Appending(fallback) .Aggregate(seed, (current, item) => current.Or(item)); var result = new AllowedMemberValues(source); return(result); }
IAllowedMemberValues Register(IServiceProvider arg) { IParameterizedSource <MemberInfo, IAllowedValueSpecification> seed = new MappedAllowedMemberValues(Specifications .ToDictionary(x => x.Key, x => (ISpecification <object>)x.Value) .Concat(Instances) .GroupBy(x => x.Key) .ToDictionary(x => x.Key, Create)), fallback = _allowed == AllowAssignedValues ? Source.Default : new FixedInstanceSource <MemberInfo, IAllowedValueSpecification>(_allowed); var source = this.Appending(fallback) .Aggregate(seed, (current, item) => current.Or(item)); var result = new AllowedMemberValues(source); return(result); }
/// <exclude /> public ConditionalSource(ISpecification <TParameter> specification, ISpecification <TResult> result, IParameterizedSource <TParameter, TResult> source, IParameterizedSource <TParameter, TResult> fallback) : this(specification.IsSatisfiedBy, result.IsSatisfiedBy, source.Get, fallback.Get) { }
public ListContentSerializer(IMemberSerializer item, string name, ILists lists) { _item = item; _name = name; _lists = lists; }
public DecoratedSource(IParameterizedSource <TParameter, TResult> source) => _source = source;
public CoercedResult(IParameterizedSource <TParameter, TResult> source, IParameterizedSource <TResult, TTo> coercer) { _coercer = coercer; _source = source; }
/// <inheritdoc /> public SpecificationSource(ISpecification <TParameter> specification, IParameterizedSource <TParameter, TResult> source) { _specification = specification; _source = source; }
public static T Get <T>(this IParameterizedSource <ImmutableArray <TypeInfo>, T> @this, params TypeInfo[] parameters) => @this.Get(parameters.ToImmutableArray());
public LinkedDecoratedSource(IParameterizedSource <TParameter, TResult> source, IParameterizedSource <TParameter, TResult> next) { _source = source; _next = next; }
public AlteredSource(IAlteration <TResult> alteration, IParameterizedSource <TParameter, TResult> source) { _alteration = alteration; _source = source; }
SingletonDefaultValueProvider( IParameterizedSource<Type, object> provider, Type hostType = null ) { this.hostType = hostType; this.provider = provider; }
public ImplicitTypeIdentities(ITypeIdentities identities, IParameterizedSource <string, TypeInfo> types) { _identities = identities; _types = types; }
public AllowedMemberValues(IParameterizedSource <MemberInfo, IAllowedValueSpecification> source) : base(source) { }
/// <inheritdoc /> public SpecificationSource(IParameterizedSource <TParameter, TResult> source) : this(source.IfAssigned(), source) { }
Evaluation(ISource <Exception> exception, IParameterizedSource <TypeInfo, object> implementation) : base(implementation) => _exception = exception;
public MemberNames(IParameterizedSource <MemberInfo, string> source) : base(source.Get) { }
public Store(ITableSource <string, object> store, IParameterizedSource <string, IMember> members) : this(store, members, TypeDefaults.Default) { }
public XmlInnerContentActivation(IActivation activation, IParameterizedSource <TypeInfo, IXmlContentsActivator> activator) { _activation = activation; _activator = activator; }
public CoercedParameter(IParameterizedSource <TFrom, TTo> coercer, IParameterizedSource <TTo, TResult> source) { _coercer = coercer; _source = source; }
public AssociationAwareReferenceMaps(IParameterizedSource <IFormatReader, IReferenceMap> maps) : base(maps.In(AssociatedReaders.Default)) { }
public static ISpecification <TParameter> IfAssigned <TParameter, TResult>( this IParameterizedSource <TParameter, TResult> @this) => @this.ToDelegate() .IfAssigned();
ReferenceCache <TParameter, TResult>(this IParameterizedSource <TParameter, TResult> @this) where TParameter : class where TResult : class => new DelegatedSource <TParameter, TResult>( ReferenceCachingAlteration <TParameter, TResult> .Default.Get(@this.ToDelegate()));
public FixedSource(IParameterizedSource <TParameter, TResult> source, TParameter parameter) : this(source.Get, parameter) { }
/// <exclude /> public ConditionalSource(ISpecification <TParameter> specification, IParameterizedSource <TParameter, TResult> source, IParameterizedSource <TParameter, TResult> fallback) : this(specification, AlwaysSpecification <TResult> .Default, source, fallback) { }
public Generic(Type definition, IParameterizedSource <TypeInfo, Func <T> > source) : base(definition, source) { }
public Names(IParameterizedSource <TypeInfo, string> source) : base(source.Get) { }
protected AttributeProviderBase() { defined = new DelegatedSpecification<Type>( Contains ).ToCachedSpecification(); factory = new Cache<Type, IEnumerable<Attribute>>( GetAttributes ); }