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); }
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); }
public static bool TryGetAggregatedAttributeValue(this IAggregatesAttributes owner, string attributeName, out string value) { value = GetAggregatedAttributeValue(owner, attributeName); return(value != null); }