Ejemplo n.º 1
0
 public Serializers(IConverters converters, IContentReaders readers, IContentWriters writers, Content.ISerializers fallback)
 {
     _converters = converters;
     _readers    = readers;
     _writers    = writers;
     _fallback   = fallback;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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> > >();
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 7
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(TextContent.Of(target), converters, culture));
 }
Ejemplo n.º 8
0
 public EnumerationConverters(IConverters converters) : base(IsAssignableSpecification <Enum> .Default,
                                                             Converters.Default, converters)
 {
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 13
0
 public AlteredConverters(Func <IConverter, IConverter> alter, IConverters converters)
 {
     _alter      = alter;
     _converters = converters;
 }
Ejemplo n.º 14
0
 public AlteredMemberContents(ISpecification <MemberInfo> specification, IAlteration <IConverter> alteration,
                              IMemberContents contents, IConverters converters, ISerializer content)
     : this(specification, AssignedSpecification, alteration, contents, converters, content)
 {
 }
Ejemplo n.º 15
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(HtmlAttribute.Of(target).Named(AttributeName), converters, culture));
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 17
0
 public IsEnumerableElement(IConverters converters)
     : base(converters.IfAssigned().Inverse(), EnumerableImplementation.Instance.IfAssigned())
 {
 }
Ejemplo n.º 18
0
 public EnumerationConverters(IConverters previous) : this(previous, Converters.Default)
 {
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 22
0
 public AlteredConverters(IAlteration <IConverter> alteration, IConverters converters)
     : this(alteration.Get, converters)
 {
 }
Ejemplo n.º 23
0
 public CachedConverters(IConverters converters) : base(converters.Get)
 {
 }
Ejemplo n.º 24
0
 internal override IQuestion <T> CreateQuestion <T>(ITarget target, IConverters <T> converters, CultureInfo culture)
 {
     return(Apply(SelectedValues.Of(target), converters, culture));
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 设定类型转换器
 /// </summary>
 /// <param name="converters">转换器</param>
 public void SetConverters(IConverters converters)
 {
     Guard.Requires <ArgumentNullException>(converters != null);
     this.converters = converters;
 }
Ejemplo n.º 26
0
 public AlteredConverters(IAlteration <IConverter> alteration, IConverters converters)
 {
     _alteration = alteration;
     _converters = converters;
 }
Ejemplo n.º 27
0
 public NullableStructureAwareContents(IConverters converters, IContents previous)
 {
     _converters = converters;
     _previous   = previous;
 }