Example #1
0
 private void ProvideSpecificTraits(ProjectionProperty property, ITraitAggregator aggregator)
 {
     PropertyScope scope;
     var scopes = specificPropertyScopes;
     if (scopes != null && scopes.TryGetValue(property.Name, out scope))
         scope.ProvideTraits(aggregator);
 }
Example #2
0
 private void ProvideGeneralTraits(ProjectionProperty property, ITraitAggregator aggregator)
 {
     var scopes = generalPropertyScopes;
     if (scopes != null)
         foreach (var scope in scopes)
             if (scope.AppliesTo(property))
                 scope.ProvideTraits(aggregator);
 }
        public void ProvideTypeTraits(ITraitAggregator aggregator)
        {
            if (aggregator == null)
                throw Error.ArgumentNull("aggregator");

            ProvideAttributes(underlyingType, aggregator);

            var scopes = this.scopes;
            if (scopes != null)
                foreach (var scope in scopes)
                    scope.ProvideTraits(aggregator);
        }
        public void ProvidePropertyTraits(
            ProjectionProperty projectionProperty,
            PropertyInfo       underlyingProperty,
            ITraitAggregator   aggregator)
        {
            if (projectionProperty == null)
                throw Error.ArgumentNull("projectionProperty");
            if (underlyingProperty == null)
                throw Error.ArgumentNull("underlyingProperty");
            if (aggregator == null)
                throw Error.ArgumentNull("aggregator");

            ProvideAttributes(underlyingProperty, aggregator);

            var scopes = this.scopes;
            if (scopes != null)
                foreach (var scope in scopes)
                    scope.ProvideTraits(projectionProperty, aggregator);
        }
 private static void ProvideAttributes(MemberInfo source, ITraitAggregator aggregator)
 {
     foreach (var trait in source.GetCustomAttributes(false))
         aggregator.Add(trait);
 }
Example #6
0
 internal void ProvideTraits(ProjectionProperty property, ITraitAggregator aggregator)
 {
     ProvideGeneralTraits (property, aggregator);
     ProvideSpecificTraits(property, aggregator);
 }
Example #7
0
 internal void ProvideTraits(ITraitAggregator aggregator)
 {
     foreach (var trait in traits)
         aggregator.Add(Realize(trait));
 }