public TValue this[TKey key] { get { if (key == null) { throw new ArgumentNullException(nameof(key)); } KeyValuePair <TKey, TValue> foundValue; var found = _root.TryFind(KeyPair(key), _comparer, out foundValue); if (!found) { throw ExceptionHelper.GetKeyNotFoundException(key); } return(foundValue.Value); } }
public bool Contains(T item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } T foundItem; return(_root.TryFind(item, _comparer, out foundItem)); }