コード例 #1
0
        public IOrderedEnumerable <T> CreateOrderedEnumerable <TKey>(Func <T, TKey> keySelector, IComparer <TKey> keyComparer, bool descending)
        {
            var secondComparer = new MyComparer <T, TKey>(keySelector, keyComparer);

            Comparers.Add(secondComparer);
            return(new MyOrderedEnumerable <T>(this, Comparers));
        }
コード例 #2
0
        public ChainComparer(IEnumerable <IComparer <T> > comparers, IEnumerable <IEqualityComparer <T> > equalityComparers)
        {
            if (comparers != null)
            {
                foreach (IComparer <T> comparer in comparers.Where(e => e != null))
                {
                    Comparers.Add(comparer);
                }
            }

            if (equalityComparers != null)
            {
                foreach (IEqualityComparer <T> equalityComparer in equalityComparers.Where(e => e != null))
                {
                    EqualityComparers.Add(equalityComparer);
                }
            }
        }
コード例 #3
0
ファイル: MultiStepComparer.cs プロジェクト: dtklinh/CRFTool
 public MultiStepComparer(IComparer <T> primaryComparer, params IComparer <T>[] secondaryComparers)
 {
     Comparers.Add(primaryComparer);
     Comparers.AddRange(secondaryComparers);
 }
コード例 #4
0
ファイル: MultiStepComparer.cs プロジェクト: dtklinh/CRFTool
 public MultiStepComparer(IComparer <T> primaryComparer, IEnumerable <IComparer <T> > secondaryComparers)
 {
     Comparers.Add(primaryComparer);
     Comparers.AddRange(secondaryComparers);
 }