public ObservableIndex(TComparer comparer, IReadOnlyIndexed <TKey, TValue> outer = null) { _inner = outer != null ? new DictionarySlim <TKey, TValue, TComparer>(outer, comparer) : new DictionarySlim <TKey, TValue, TComparer>(comparer); _observers = new WeakCollection <IObserver <ObservableEvent <TValue> > >(); if (outer is IObservable <ObservableEvent <TValue> > observableDictionary) { observableDictionary.Subscribe(this); } }
public DictionarySlim(DictionarySlim <TKey, TValue, TComparer> other) { _comparer = other._comparer; _buckets = new int[other._buckets.Length]; _entries = new Entry[other._entries.Length]; var enumerator = new Enumerator(other); while (enumerator.MoveNext()) { var current = enumerator.Current; AddOrReplace(current.Key, current.Value); } }
public LookupSlim(TComparer comparer) { _comparer = comparer; _inner = new DictionarySlim <TKey, TValue, TComparer>(comparer); }
public CascadeIndex(TComparer comparer) { Outer = null; _inner = new DictionarySlim <TKey, TValue, TComparer>(comparer); }