public Serializers(IConverters converters, IContentReaders readers, IContentWriters writers, Content.ISerializers fallback)
 {
     _converters = converters;
     _readers    = readers;
     _writers    = writers;
     _fallback   = fallback;
 }
Exemple #2
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     if (typeof(T) == typeof(bool) && Contains != null)
     {
         return(Classes.Of(target).WithCulture(culture).Select(c => (T)(object)c.Contains(Contains)));
     }
     return(Apply(Classes.Of(target), converters, culture));
 }
Exemple #3
0
        /// <summary>
        /// 构造配置容器
        /// </summary>
        /// <param name="converters">转换器</param>
        /// <param name="locator">配置定位器</param>
        public Config(IConverters converters, IConfigLocator locator)
        {
            Guard.Requires <ArgumentNullException>(converters != null);
            Guard.Requires <ArgumentNullException>(locator != null);

            this.converters = converters;
            this.locator    = locator;
            watches         = new Dictionary <string, List <Action <object> > >();
        }
Exemple #4
0
 public AlteredMemberContents(ISpecification <MemberInfo> specification, ISpecification <IConverter> assigned,
                              IAlteration <IConverter> alteration,
                              IMemberContents contents, IConverters converters, ISerializer content)
 {
     _specification = specification;
     _assigned      = assigned;
     _alteration    = alteration;
     _contents      = contents;
     _converters    = converters;
     _content       = content;
 }
 public IConversionExpressionWithValue Convert(IConversionExpression expression, bool toMetric)
 {
     mToMetric  = toMetric;
     mConverter = mConverterFactory(toMetric);
     if (!CheckIfVisitorIsNecessary(expression))
     {
         return(ConvertSingleExpression(expression));
     }
     expression.Accept(this);
     return(mResult);
 }
 public MemberSerializers(ISpecification <MemberInfo> content, ISerializer serializer, IIdentities identities,
                          ISerializers serializers, IMemberSerializers members, IConverters converters,
                          IContentMember member)
 {
     _content     = content;
     _serializer  = serializer;
     _identities  = identities;
     _serializers = serializers;
     _members     = members;
     _converters  = converters;
     _member      = member;
 }
Exemple #7
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(TextContent.Of(target), converters, culture));
 }
Exemple #8
0
 public EnumerationConverters(IConverters converters) : base(IsAssignableSpecification <Enum> .Default,
                                                             Converters.Default, converters)
 {
 }
Exemple #9
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(CssValue.Of(target).AndTheProperty(PropertyName), converters, culture));
 }
 public MemberConverters(IMemberConverterSpecification specification, IConverters converters)
 {
     _specification = specification;
     _converters    = converters;
 }
 public MemberSerializers(ISerializer serializer, IIdentities identities, ISerializers serializers,
                          IMemberSerializers members, IConverters converters, IContentMember member)
     : this(IsContent.Instance, serializer, identities, serializers, members, converters, member)
 {
 }
 public ConverterSpecification(IConverters converters) : base(converters.Get)
 {
 }
Exemple #13
0
 public AlteredConverters(Func <IConverter, IConverter> alter, IConverters converters)
 {
     _alter      = alter;
     _converters = converters;
 }
Exemple #14
0
 public AlteredMemberContents(ISpecification <MemberInfo> specification, IAlteration <IConverter> alteration,
                              IMemberContents contents, IConverters converters, ISerializer content)
     : this(specification, AssignedSpecification, alteration, contents, converters, content)
 {
 }
Exemple #15
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(HtmlAttribute.Of(target).Named(AttributeName), converters, culture));
 }
Exemple #16
0
 public ReferenceContents(IReferenceEncounters identifiers, IReferenceMaps maps, IEntities entities,
                          IContents option, IClassification classification, IConverters converters)
     : this(Specification, converters.IfAssigned(), identifiers, maps, entities, option, classification)
 {
 }
 public IsEnumerableElement(IConverters converters)
     : base(converters.IfAssigned().Inverse(), EnumerableImplementation.Instance.IfAssigned())
 {
 }
Exemple #18
0
 public EnumerationConverters(IConverters previous) : this(previous, Converters.Default)
 {
 }
Exemple #19
0
 internal static IQuestion <T> Apply <T, TUIState>(SingleUIState <ImmutableArray <string>, TUIState> uiState, IConverters <T> converters, CultureInfo culture)
     where TUIState : SingleUIState <ImmutableArray <string>, TUIState>
 {
     return(uiState.WithCulture(culture).As <T>(converters));
 }
Exemple #20
0
 internal abstract IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture);
 public MemberSerializers(ISerializer serializer, IIdentities identities, ISerializers serializers,
                          IMemberSerializers members, IConverters converters, IContentMember member)
     : this(IsDefinedSpecification <XmlTextAttribute> .Default, serializer, identities, serializers, members,
            converters, member)
 {
 }
Exemple #22
0
 public AlteredConverters(IAlteration <IConverter> alteration, IConverters converters)
     : this(alteration.Get, converters)
 {
 }
Exemple #23
0
 public CachedConverters(IConverters converters) : base(converters.Get)
 {
 }
Exemple #24
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(SelectedValues.Of(target), converters, culture));
 }
Exemple #25
0
 /// <summary>
 /// 设定类型转换器
 /// </summary>
 /// <param name="converters">转换器</param>
 public void SetConverters(IConverters converters)
 {
     Guard.Requires <ArgumentNullException>(converters != null);
     this.converters = converters;
 }
Exemple #26
0
 public AlteredConverters(IAlteration <IConverter> alteration, IConverters converters)
 {
     _alteration = alteration;
     _converters = converters;
 }
Exemple #27
0
 public NullableStructureAwareContents(IConverters converters, IContents previous)
 {
     _converters = converters;
     _previous   = previous;
 }