예제 #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
 public KeyValueCollection()
 {
     Optimisations = SortOptimisations.None;
     _items        = new List <KeyValuePair <TKey, TObject> >();
     Comparer      = new KeyValueComparer <TObject, TKey>();
 }
예제 #3
0
 public IChangeSet <TObject, TKey> ChangeComparer(KeyValueComparer <TObject, TKey> comparer)
 {
     _comparer = comparer;
     return(ChangeSet <TObject, TKey> .Empty);
 }
예제 #4
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> >();
 }
예제 #5
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));
 }
예제 #6
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          = ImmutableList <KeyValuePair <TKey, TObject> > .Empty;
 }
예제 #7
0
 public IChangeSet <TObject, TKey> ChangeComparer(KeyValueComparer <TObject, TKey> comparer)
 {
     _comparer = comparer;
     _list     = _list.OrderBy(kv => kv, _comparer).ToList();
     return(ChangeSet <TObject, TKey> .Empty);
 }