- attr
- Documentation for this section has not yet been entered.
true if the attribute is contained within the collection and has the same value as the attribute in the collection; otherwise, false.
An attribute can provide support for matching.
The difference between the AttributeCollection.Matches(Attribute) and AttributeCollection.Contains(Attribute) methods is that AttributeCollection.Matches(Attribute) calls the Attribute.Match(object) method on an attribute, and AttributeCollection.Contains(Attribute) calls the object.Equals(object) method.
For most attributes, these methods do the same thing. For attributes that may have multiple flags, however, Attribute.Match(object) is typically implemented so that it returns true if any of the flags are satisfied. For example, consider a data binding attribute with the Boolean flags "SupportsSql", "SupportsOleDb", and "SupportsXml". This attribute may be present on a property that supports all three data binding approaches. It will often be the case that a programmer needs to know only if a particular approach is available, not all three. Therefore, a programmer could use Attribute.Match(object) with an instance of the attribute containing only the flags the programmer needs.