Example #1
0
        public static AttributeCollection GetAggregatedAttributes(this IAggregatesAttributes owner)
        {
            var aggregateAttributes = new AttributeCollection();

            if (owner.AttributeParent != null)
            {
                aggregateAttributes.AddOrUpdateAttributes(owner.AttributeParent.GetAggregatedAttributes());
            }

            aggregateAttributes.AddOrUpdateAttributes(owner.ExplicitAttributes);

            return(aggregateAttributes);
        }
Example #2
0
        public static string GetAggregatedAttributeValue(this IAggregatesAttributes owner, string attributeName)
        {
            if (owner.ExplicitAttributes.Contains(attributeName))
            {
                return(owner.ExplicitAttributes[attributeName].Value);
            }
            else if (owner.AttributeParent != null)
            {
                return(owner.AttributeParent.GetAggregatedAttributeValue(attributeName));
            }

            return(null);
        }
Example #3
0
        public static bool TryGetAggregatedAttributeValue(this IAggregatesAttributes owner, string attributeName, out string value)
        {
            value = GetAggregatedAttributeValue(owner, attributeName);

            return(value != null);
        }