コード例 #1
0
ファイル: MemoryCache.cs プロジェクト: ilkerhalil/KVLite
        /// <summary>
        ///   Performs application-defined tasks associated with freeing, releasing, or resetting
        ///   unmanaged resources.
        /// </summary>
        /// <param name="disposing">True if it is a managed dispose, false otherwise.</param>
        /// <remarks>
        ///   When called on a cache using <see cref="SystemMemoryCache.Default"/> as store, this
        ///   method does nothing. In fact, it is not safe to dispose the default memory cache instance.
        /// </remarks>
        protected override void Dispose(bool disposing)
        {
            if (!disposing)
            {
                // Nothing to do, we can handle only managed Dispose calls.
                return;
            }

            if (_store != null && _store != SystemMemoryCache.Default)
            {
                _store.Dispose();
                _store = null;
            }
        }
コード例 #2
0
 public void ReleaseCache(System.Runtime.Caching.MemoryCache cache)
 {
     if (cache != null)
     {
         cache.Dispose();
     }
 }
コード例 #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         _memoryCache?.Dispose();
     }
 }
コード例 #4
0
ファイル: Cache.cs プロジェクト: PowerOlive/Atlas-5
 public void Dispose()
 {
     cache?.Dispose();
 }
コード例 #5
0
 public static void ClearCache()
 {
     _memCache.Dispose();
     _memCache  = new System.Runtime.Caching.MemoryCache("HopsCache");
     EntryCount = 0;
 }
コード例 #6
0
 public void Dispose()
 {
     _cache.Dispose();
 }