Exemple #1
0
 public ReversibleSortedList(SortDirectionComparer <TKey> comparer)
     : this()
 {
     if (comparer != null)
     {
         this._sortDirectionComparer = comparer;
         this._currentSortDirection  = _sortDirectionComparer.SortDirection;
     }
 }
Exemple #2
0
 public ReversibleSortedList(IDictionary <TKey, TValue> dictionary,
                             SortDirectionComparer <TKey> comparer)
     : this((dictionary != null) ? dictionary.Count : 0, comparer)
 {
     if (dictionary == null)
     {
         throw new ArgumentNullException("dictionary");
     }
     dictionary.Keys.CopyTo(this.keys, 0);
     dictionary.Values.CopyTo(this.values, 0);
     Array.Sort <TKey, TValue>(this.keys, this.values,
                               this._sortDirectionComparer);
     this._size = dictionary.Count;
 }
Exemple #3
0
 public ReversibleSortedList(int capacity, SortDirectionComparer <TKey> comparer)
     : this(comparer)
 {
     this.Capacity = capacity;
 }