public Sorter(SortOptimisations optimisations, IComparer <TObject> comparer = null, int resetThreshold = -1) { _optimisations = optimisations; _resetThreshold = resetThreshold; _comparer = new KeyValueComparer <TObject, TKey>(comparer); }
public KeyValueCollection() { Optimisations = SortOptimisations.None; _items = new List <KeyValuePair <TKey, TObject> >(); Comparer = new KeyValueComparer <TObject, TKey>(); }
public IChangeSet <TObject, TKey> ChangeComparer(KeyValueComparer <TObject, TKey> comparer) { _comparer = comparer; return(ChangeSet <TObject, TKey> .Empty); }
/// <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> >(); }
/// <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)); }
/// <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; }
public IChangeSet <TObject, TKey> ChangeComparer(KeyValueComparer <TObject, TKey> comparer) { _comparer = comparer; _list = _list.OrderBy(kv => kv, _comparer).ToList(); return(ChangeSet <TObject, TKey> .Empty); }