Click or drag to resize
ListTSort Method (IComparerT)

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public void Sort(
	IComparer<T> comparer
)

Parameters

comparer
Type: System.Collections.GenericIComparerT
The IComparerT implementation to use when comparing elements, or null to use the default comparer Default.
Exceptions
ExceptionCondition
InvalidOperationExceptioncomparer is null, and the default comparer Default cannot find implementation of the IComparableT generic interface or the IComparable interface for type T.
ArgumentExceptionThe implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
See Also