Match Method

Attribute.Match Method (Object)


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

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

abstract Match : 
        obj:Object -> bool
override Match : 
        obj:Object -> bool


Type: System.Object

An Object to compare with this instance of Attribute.

Return Value

Type: System.Boolean

true if this instance equals obj; otherwise, false.

This method determines if one Attribute equals another. Its default implementation is the same as Equals, 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 Equals method cannot determine that the two instances have the same flag set, but the Match method can.

The following code example illustrates the use of Match in the context of Attribute.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft