Table of Contents

Class SortExtensions

Namespace
ExControls
Assembly
ExControls.dll

Sorting extension methods with a Comparison<T> delegate.

public static class SortExtensions
Inheritance
SortExtensions
Inherited Members

Methods

OrderBy<T>(IEnumerable<T>, Comparison<T>)

Convenience method on IEnumerable{T} to allow passing of a Comparison{T} delegate to the OrderBy method.

public static IEnumerable<T> OrderBy<T>(this IEnumerable<T> list, Comparison<T> comparison)

Parameters

list IEnumerable<T>

items to sort

comparison Comparison<T>

comparison of the items

Returns

IEnumerable<T>

the items sorted by comparison

Type Parameters

T

type of the items

Sort<T>(IList<T>)

Sorts an IList{T} in place, when T is IComparable{T}

public static void Sort<T>(this IList<T> list) where T : IComparable<T>

Parameters

list IList<T>

list to sort

Type Parameters

T

type of the items

Sort<T>(IList<T>, Comparison<T>)

Sorts an IList{T} in place.

public static void Sort<T>(this IList<T> list, Comparison<T> comparison)

Parameters

list IList<T>

list to sort

comparison Comparison<T>

comparison of the items

Type Parameters

T

type of the items