Microsoft Silverlight will reach end of support after October 2021. Learn more.
Defines a method that a type implements to compare two objects.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Interface IComparer(Of In T)
public interface IComparer<in T>
The type of objects to compare.
This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see 2678dc63-c7f9-4590-9ddc-0a4df684d42e.
The IComparer<T> type exposes the following members.
|Compare||Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.|
This interface supports ordering comparisons. That is, when the Compare method returns 0, it means that two objects sort the same. Implementation of exact equality comparisons is provided by the IEqualityComparer<T> generic interface.
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
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.