// Creates a new OrderedEnumerable that will sort 'source' according to 'ordering'. public OrderedEnumerable(IEnumerable <TSource> source, ElementComparer <TSource> elementComparer) { m_source = source; m_elementComparer = elementComparer; }
public IOrderedEnumerable <TSource> CreateOrderedEnumerable <TKey>(Func <TSource, TKey> keySelector, IComparer <TKey> comparer, bool descending) { ElementComparer <TSource, TKey> elementComparer = new ElementComparer <TSource, TKey>(keySelector, comparer ?? Comparer <TKey> .Default, descending, null); return(new OrderedEnumerable <TSource>(m_source, m_elementComparer.Append(elementComparer))); }
// Creates a new ElementComparer by appending the specified ordering to this ordering, chaining them together. public abstract ElementComparer <TSource> Append(ElementComparer <TSource> next);