public bool ContainsKey(TKey key) { this.RWLock.AcquireReaderLock(lockTimeout); try { return(InnerDict.Contains(key)); } finally { this.RWLock.ReleaseReaderLock(); } }
protected override void OnRemove(int index, object value) { ExceptionHelper.TrueThrow <ArgumentNullException>(value == null, "value"); this.RWLock.AcquireWriterLock(lockTimeout); try { TKey key = GetKeyFromItem((TValue)value); TValue data = (TValue)value; ExceptionHelper.FalseThrow <ArgumentException>(InnerDict.Contains(key), Resource.InexistenceKey, typeof(TValue).Name, key); InnerDict.Remove(key); base.OnRemove(index, data); } finally { this.RWLock.ReleaseWriterLock(); } }