Skip to content
Riaan Hanekom edited this page Mar 10, 2013 · 4 revisions

The ISorter Interface

public interface ISorter<T>
{
      // Methods
      void Sort(IList<T> list);
      void Sort(IList<T> list, SortOrder order);
      void Sort(IList<T> list, IComparer<T> comparer);
      void Sort(IList<T> list, Comparison<T> comparison);
}

Multiple sorters are implemented in this library. The default .NET framework libraries don't give us much choice in terms of sorting, and thus these were born. It's generic in the sense that any class implementing IList can be sorted, as long as the contained items either implement the IComparable interface or a IComparer instance is provided.