Freigeben über


EqualityComparer<T>.IEqualityComparer.GetHashCode Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns a hash code for the specified object.

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

Syntax

'Declaration
Private Function GetHashCode ( _
    obj As Object _
) As Integer Implements IEqualityComparer.GetHashCode
int IEqualityComparer.GetHashCode(
    Object obj
)

Parameters

Return Value

Type: System.Int32
A hash code for the specified object.

Implements

IEqualityComparer.GetHashCode(Object)

Exceptions

Exception Condition
ArgumentNullException

The type of obj is a reference type and obj is nulla null reference (Nothing in Visual Basic).

-or-

obj is of a type that cannot be cast to type T.

Remarks

This method is a wrapper for the GetHashCode(T) method, so obj must be a type that can be cast to the type specified by the generic type argument T of the current instance.

Version Information

Silverlight

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

Platforms

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