示例#1
0
 public Sorter(SortOptimisations optimisations,
               IComparer <TObject> comparer = null,
               int resetThreshold           = -1)
 {
     _optimisations  = optimisations;
     _resetThreshold = resetThreshold;
     _comparer       = new KeyValueComparer <TObject, TKey>(comparer);
 }
示例#2
0
 /// <summary>
 /// Sorts all data using the specified comparer
 /// </summary>
 /// <param name="comparer">The comparer.</param>
 /// <returns></returns>
 public ISortedChangeSet <TObject, TKey> Sort(IComparer <TObject> comparer)
 {
     _comparer = new KeyValueComparer <TObject, TKey>(comparer);
     return(DoSort(SortReason.ComparerChanged));
 }
示例#3
0
 public IChangeSet <TObject, TKey> ChangeComparer(KeyValueComparer <TObject, TKey> comparer)
 {
     _comparer = comparer;
     return(ChangeSet <TObject, TKey> .Empty);
 }
示例#4
0
 public KeyValueCollection()
 {
     Optimisations = SortOptimisations.None;
     _items        = new List <KeyValuePair <TKey, TObject> >();
     Comparer      = new KeyValueComparer <TObject, TKey>();
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public IndexCalculator(KeyValueComparer <TObject, TKey> comparer, SortOptimisations optimisations)
 {
     _comparer      = comparer;
     _optimisations = optimisations;
     _list          = new List <KeyValuePair <TKey, TObject> >();
 }