Provides a base class for implementations of the IComparer`1 generic interface.
See Also: Comparer<T> Members
- Documentation for this section has not yet been entered.
To specify how two objects should be compared by default, implement the IComparable interface in your class. This ensures that sort operations will use the default comparison code that you provided.
To define a comparer to use instead of the default comparer, derive from the Comparer`1 class. You can then use this comparer in sort operations that take a comparer as a parameter.
The object returned by the Comparer`1.Default property uses the IComparable`1 generic interface (IComparable<T> in C#, IComparable(Of T) in Visual Basic) to compare two objects. If type T does not implement the IComparable`1 generic interface, the Comparer`1.Default property returns a Comparer`1 that uses the IComparable interface.