Ejemplo n.º 1
0
 public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification)
 {
     if (DateTimeValueSemanticsProvider.IsAdaptedType(type))
     {
         var spec = reflector.LoadSpecification <IObjectSpecImmutable>(DateTimeValueSemanticsProvider.AdaptedType);
         AddValueFacets(new DateTimeValueSemanticsProvider(spec, specification), specification);
     }
 }
        public override IImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, IImmutableDictionary <string, ITypeSpecBuilder> metamodel)
        {
            if (!DateTimeValueSemanticsProvider.IsAdaptedType(type))
            {
                return(metamodel);
            }

            var(oSpec, mm) = reflector.LoadSpecification <IObjectSpecImmutable>(DateTimeValueSemanticsProvider.AdaptedType, metamodel);
            AddValueFacets(new DateTimeValueSemanticsProvider(oSpec, specification), specification);
            return(mm);
        }
Ejemplo n.º 3
0
        public override ImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, ImmutableDictionary <string, ITypeSpecBuilder> metamodel)
        {
            if (DateTimeValueSemanticsProvider.IsAdaptedType(type))
            {
                var result = reflector.LoadSpecification(DateTimeValueSemanticsProvider.AdaptedType, metamodel);

                metamodel = result.Item2;
                var spec = result.Item1 as IObjectSpecImmutable;
                AddValueFacets(new DateTimeValueSemanticsProvider(spec, specification), specification);
            }
            return(metamodel);
        }