public CacheItemHolder( T value, CacheSetting cacheItemInfo) { this.Value = value; this.cacheItemInfo = cacheItemInfo; }
public void Set(string key, object value, CacheSetting itemInfo) { lock (thisLock) { DateTime expiredtime = DateTime.Now; switch (itemInfo.ExpirationMode) { case CacheExpirationMode.Absolute: expiredtime = itemInfo.AbsoluteExpiration; break; case CacheExpirationMode.Sliding: expiredtime = expiredtime.Add(itemInfo.SlidingExpiration); break; case CacheExpirationMode.Never: client.Store(StoreMode.Set, key, value); return; default: break; } client.Store(StoreMode.Set, key, value, expiredtime); } }
public CacheItemHolder( CacheManager cache, CacheSetting cacheItemInfo) { this.cache = cache; this.cacheItemInfo = cacheItemInfo; }
public void Set( string key, object value, CacheSetting itemInfo) { lock ( thisLock ) { OnBeforeValueSet(); inMemoryCache[key] = new CacheItem( key, value, itemInfo); LogCentral.Current.Debug( string.Format( @"[»º³å] ÔÚ'{0}' Ìí¼ÓÁËÒÔϵĻº³å×é: " + @"¼ü(key) ='{1}', Öµ(value) '{2}'.", DateTime.Now, key, inMemoryCache[key].Dump())); CheckCurrentSize(); OnAfterValueSet(); } }
public void Set( string key, object value, CacheSetting itemInfo) { lock (thisLock) { DateTime expiredtime = DateTime.Now; ICacheItemExpiration expire = null; switch (itemInfo.ExpirationMode) { case CacheExpirationMode.Absolute: expiredtime = itemInfo.AbsoluteExpiration; expire = new CacheItemExpiration(expiredtime); break; case CacheExpirationMode.Sliding: expiredtime = expiredtime.Add(itemInfo.SlidingExpiration); expire = new SlidingCacheItemExpiration(itemInfo.SlidingExpiration); break; case CacheExpirationMode.Never: client.Add(key, value); return; default: break; } client.Add(key, value, CacheItemPriority.Normal, new NullCacheItemRefreshAction(), expire); } }
public CacheItem( string key, object value, CacheSetting cacheInfo) { this.key = key; this.value = value; this.cacheInfo = cacheInfo; }
public virtual void Set( string key, object value, TimeSpan ts) { lock (thisLock) { CacheSetting cs = new CacheSetting(); cs.AbsoluteExpiration = DateTime.Now.Add(ts); Set(key, value, cs); } }
public virtual void Set( string key, object value, DateTime absoluteDateTime) { lock (thisLock) { CacheSetting cs = new CacheSetting(); cs.AbsoluteExpiration = absoluteDateTime; Set(key, value, cs); } }
public virtual void Set( string key, object value, CacheSetting itemInfo) { lock ( thisLock ) { if (backer != null) { backer.Set(key, value, itemInfo); } } }
public CacheItemHolder( CacheSetting cacheItemInfo) { this.cacheItemInfo = cacheItemInfo; }