public ExtendedReadOnlyDictionary(IDictionary <TKey, TValue> dictionary) { if (dictionary == null) { throw new ArgumentNullException("dictionary"); } _wrapped = dictionary; _keys = new ExtendedReadOnlyCollection <TKey>(new DelegatedCollection <TKey>(() => _wrapped.Keys)); _values = new ExtendedReadOnlyCollection <TValue>(new DelegatedCollection <TValue>(() => _wrapped.Values)); }
public ExtendedReadOnlyDictionary(IDictionary <TKey, TValue> dictionary) { _wrapped = Check.NotNullArgument(dictionary, "dictioanry"); _keys = new ExtendedReadOnlyCollection <TKey>(new DelegatedCollection <TKey>(() => _wrapped.Keys)); _values = new ExtendedReadOnlyCollection <TValue>(new DelegatedCollection <TValue>(() => _wrapped.Values)); }