WeakKeyDictionary(SerializationInfo serializationInfo, StreamingContext streamingContext) { var comparer = (KeyComparer <TWeakKey1, TStrongKey>)serializationInfo.GetValue("Comparer", typeof(KeyComparer <TWeakKey1, TStrongKey>)); var items = (List <KeyValuePair <Tuple <TWeakKey1, TStrongKey>, TValue> >)serializationInfo.GetValue("Items", typeof(List <KeyValuePair <Tuple <TWeakKey1, TStrongKey>, TValue> >)); _internalDictionary = new InternalWeakKeyDictionary(comparer); _internalDictionary.InsertContents(items); }
public WeakKeyDictionary(int concurrencyLevel, int capacity, IEqualityComparer <TWeakKey1> weakKeyComparer, IEqualityComparer <TStrongKey> strongKeyComparer) { _internalDictionary = new InternalWeakKeyDictionary( concurrencyLevel, capacity, new KeyComparer <TWeakKey1, TStrongKey>(weakKeyComparer, strongKeyComparer) ) ; }
public WeakKeyDictionary(IEnumerable <KeyValuePair <Tuple <TWeakKey1, TStrongKey>, TValue> > collection, IEqualityComparer <TWeakKey1> weakKeyComparer, IEqualityComparer <TStrongKey> strongKeyComparer) { _internalDictionary = new InternalWeakKeyDictionary( new KeyComparer <TWeakKey1, TStrongKey>(weakKeyComparer, strongKeyComparer) ) ; _internalDictionary.InsertContents(collection); }
public WeakKeyDictionary(int concurrencyLevel, IEnumerable <KeyValuePair <Tuple <TWeakKey1, TStrongKey>, TValue> > collection, IEqualityComparer <TWeakKey1> weakKeyComparer, IEqualityComparer <TStrongKey> strongKeyComparer) { var contentsList = collection.ToList(); _internalDictionary = new InternalWeakKeyDictionary( concurrencyLevel, contentsList.Count, new KeyComparer <TWeakKey1, TStrongKey>(weakKeyComparer, strongKeyComparer) ) ; _internalDictionary.InsertContents(contentsList); }