System.Collections.IComparer

Exposes a method that compares two objects.

See Also: IComparer Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public interface IComparer

Remarks

This interface is used in conjunction with the Array.Sort(Array) and Array.BinarySearch(Array, object) methods. It provides a way to customize the sort order of a collection. See the IComparer.Compare(object, object) method for notes on parameters and return value.

The default implementation of this interface is the Comparer class. For the generic version of this interface, see IComparer`1.

Requirements

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