System.Web.Caching.CacheItemPriorityQueue.OnItemDisable C# (CSharp) Method

OnItemDisable() private method

private OnItemDisable ( System.Web.Caching.CacheItem i ) : void
i System.Web.Caching.CacheItem
return void
		public void OnItemDisable (CacheItem i)
		{
#if DEBUG
			CacheItem item;
			if (!items.TryGetValue (i.Guid, out item))
				return;

			EDSequence.Add (new EDSequenceEntry (CopyItem (i), EDSequenceEntryType.Disable));
#endif
		}

Usage Example

        // Must ALWAYS be called with the cache write lock held
        CacheItem RemoveCacheItem(string key)
        {
            if (key == null)
            {
                return(null);
            }

            CacheItem ret = cache [key];

            if (ret == null)
            {
                return(null);
            }

            if (timedItems != null)
            {
                timedItems.OnItemDisable(ret);
            }

            ret.Disabled = true;
            cache.Remove(key);

            return(ret);
        }