EqualityComparer<T>.IEqualityComparer.Equals Method

Determines whether the specified objects are equal.

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


Private Function Equals ( _
    x As Object, _
    y As Object _
) As Boolean Implements IEqualityComparer.Equals
bool IEqualityComparer.Equals(
    Object x,
    Object y


Return Value

Type: System.Boolean
true if the specified objects are equal; otherwise, false.


IEqualityComparer.Equals(Object, Object)


Exception Condition

x or y is of a type that cannot be cast to type T.


This method is a wrapper for the Equals(T, T) method, so obj must be cast to the type specified by the generic argument T of the current instance. If it cannot be cast to T, an ArgumentException is thrown.

Comparing nulla null reference (Nothing in Visual Basic) is allowed and does not generate an exception.

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.