コード例 #1
0
        private void CacheItemRemoved(CacheEntryRemovedArguments arguments)
        {
            var item = arguments.CacheItem;
            var args = new MicroCacheItemRemovedEventArgs <T>(item.Key, ((LazyLock)item.Value).Get <T>(null));

            OnCacheItemRemoved(args);
        }
コード例 #2
0
 protected virtual void OnCacheItemRemoved(MicroCacheItemRemovedEventArgs <T> e)
 {
     if (this.ItemRemoved != null)
     {
         ItemRemoved(this, e);
     }
 }
コード例 #3
0
 protected virtual void cacheProvider_ItemRemoved(object sender, MicroCacheItemRemovedEventArgs <T> e)
 {
     // Skip the event if the item is null, empty, or otherwise a default value,
     // since nothing was actually put in the cache, so nothing was removed
     if (!EqualityComparer <T> .Default.Equals(e.Item, default(T)))
     {
         // Cascade the event
         OnCacheItemRemoved(e);
     }
 }
コード例 #4
0
        /// <summary>
        /// This method is called when an item has been removed from the cache.
        /// </summary>
        /// <param name="key">Cached item key.</param>
        /// <param name="item">Cached item.</param>
        /// <param name="reason">Reason the cached item was removed.</param>
        protected virtual void OnItemRemoved(string key, object item, CacheItemRemovedReason reason)
        {
            var args = new MicroCacheItemRemovedEventArgs <T>(key, ((LazyLock)item).Get <T>(null));

            OnCacheItemRemoved(args);
        }
コード例 #5
0
 private void cacheProvider_ItemRemoved(object sender, MicroCacheItemRemovedEventArgs <T> e)
 {
     // Cascade the event
     OnCacheItemRemoved(e);
 }