コード例 #1
0
            private int[] GetOrderedIndexArray(EnumerableSorted <TSource, TKey> orderCriteriaHead)
            {
                //@todo: re-implement List<> as lightweight, make Sort() a utility method
                //@todo: write own utilities for Enumerable.Range remove reliance to Linq utilities
                List <int> map = new List <int>(Enumerable.Range(0, sourceList.Count));

                map.Sort(orderCriteriaHead);
                return(map.ToArray());
            }
コード例 #2
0
        public EnumerableOrderBy(IEnumerable <TSource> source, Func <TSource, TKey> keySelector, bool decending, IComparer <TKey> comparer)
        {
            if (source == null)
            {
                throw new ArgumentNullException("'source' can't be null");
            }

            this.source = source;
            orderRule   = new EnumerableSorted <TSource, TKey>(keySelector, decending, comparer, this);
        }