System.Attribute.Match Method

When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

Syntax

public virtual bool Match (object obj)

Parameters

obj
An object to compare with this instance of Attribute.

Returns

true if this instance equals obj; otherwise, false.

Remarks

This method determines if one Attribute equals another. Its default implementation is the same as Attribute.Equals(object), which performs a value and reference comparison. Override this method to implement support for attribute values, such as flags or bit fields, that consist of components that are meaningful in themselves.

For example, consider an attribute whose value is a binary field divided into a bit field of flags. Two instances of this attribute have one flag in set in common while all the other flags differ. The Attribute.Equals(object) method cannot determine that the two instances have the same flag set, but the Attribute.Match(object) method can.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0