Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
 // Creates a new ElementComparer by appending the specified ordering to this ordering, chaining them together.
 public abstract ElementComparer <TSource> Append(ElementComparer <TSource> next);
Exemplo n.º 3
0
 // 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;
 }