Esempio n. 1
0
        public bool TrySet(string name, RetainableDeepZoomGenerator dz)
        {
            var cacheEntryOption = new MemoryCacheEntryOptions
            {
                SlidingExpiration = TimeSpan.FromMinutes(3)
            };

            cacheEntryOption.RegisterPostEvictionCallback(ItemEvicted);
            RetainableDeepZoomGenerator cachedDz = _cache.Set(name, dz, cacheEntryOption);

            return(ReferenceEquals(cachedDz, dz));
        }
Esempio n. 2
0
 public bool TryGet(string name, out RetainableDeepZoomGenerator dz)
 {
     return(_cache.TryGetValue(name, out dz));
 }