/// <summary> /// Method called by the EvaluationEngine when an attribute is not found. /// </summary> /// <param name="context">The evaluation context instance.</param> /// <param name="designator">The attribute designator.</param> /// <returns>An instance of an Attribute with it's value.</returns> public AttributeElement GetAttribute(EvaluationContext context, AttributeDesignatorBase designator) { if (context == null) { throw new ArgumentNullException("context"); } if (designator == null) { throw new ArgumentNullException("designator"); } foreach (var attrib in _attributes.Cast <AttributeElement>().Where(attrib => attrib.AttributeId == designator.AttributeId)) { if (!string.IsNullOrEmpty(designator.Issuer)) { if (designator.Issuer == attrib.Issuer) { return(attrib); } } else { return(attrib); } } return(null); }
/// <summary> /// Matches the designator within the values of this attribute element. /// </summary> /// <param name="attributeDesignator">The attribute designator instance.</param> /// <returns><c>true</c> if the designator matches with this attribute.</returns> public bool Match(AttributeDesignatorBase attributeDesignator) { if (attributeDesignator == null) { throw new ArgumentNullException("attributeDesignator"); } if (AttributeId != attributeDesignator.AttributeId || DataType != attributeDesignator.DataType) { return(false); } if (string.IsNullOrEmpty(attributeDesignator.Issuer)) { return(true); } return(Issuer == attributeDesignator.Issuer); }
/// <summary> /// Matches the designator within the values of this attribute element. /// </summary> /// <param name="attributeDesignator">The attribute designator instance.</param> /// <returns><c>true</c> if the designator matches with this attribute.</returns> public bool Match(AttributeDesignatorBase attributeDesignator) { if (attributeDesignator == null) throw new ArgumentNullException("attributeDesignator"); if (AttributeId != attributeDesignator.AttributeId || DataType != attributeDesignator.DataType) return false; if (string.IsNullOrEmpty(attributeDesignator.Issuer)) return true; return Issuer == attributeDesignator.Issuer; }