internal CacheItem(object key, object value, CacheKeyDependency dependency) { if (key == null) { throw new ArgumentNullException("key"); } this._key = key; this._value = value; this._removedReason = ObjectCacheItemRemovedReason.Underused; this._dateCreated = DateTime.UtcNow; this._absoluteExpiration = this._dateCreated.AddSeconds(300.0); this._dependency = dependency; this._callback = null; }
protected virtual void Remove(object key, ObjectCacheItemRemovedReason reason) { if (key == null) { throw new ArgumentNullException("key"); } if ((this._items != null) && this._items.ContainsKey(key)) { lock (this._items.SyncRoot) { if (this._items.ContainsKey(key)) { CacheItem item = this._items[key] as CacheItem; if (item != null) { item.RemovedReason = reason; item.Release(); } } } } }