磁盘缓存管理器,磁盘缓存管理器负责打开调度文件打开和关闭,过期缓存清理等
Inheritance: IDisposable
Example #1
0
    /// <summary>
    /// 创建 DiskCacheProvider 对象
    /// </summary>
    /// <param name="path">磁盘缓存路径</param>
    /// <param name="serializer">二进制序列化器</param>
    public DiskCacheProvider( string path, IFormatter serializer )
    {
      if ( Path.IsPathRooted( path ) == false )
        throw new ArgumentException( "must be a rooted path", path );

      _manager = new DiskCacheManager( path );
      _serializer = serializer;

      _manager.Initialize();
    }
Example #2
0
        /// <summary>
        /// 创建 DiskCacheProvider 对象
        /// </summary>
        /// <param name="path">磁盘缓存路径</param>
        /// <param name="serializer">二进制序列化器</param>
        public DiskCacheProvider(string path, IFormatter serializer)
        {
            if (Path.IsPathRooted(path) == false)
            {
                throw new ArgumentException("must be a rooted path", path);
            }

            _manager    = new DiskCacheManager(path);
            _serializer = serializer;

            _manager.Initialize();
        }
Example #3
0
 /// <summary>
 /// 释放所有资源,停止提供缓存
 /// </summary>
 public void Dispose()
 {
     _manager.Dispose();
     _manager = null;
 }
Example #4
0
 /// <summary>
 /// 释放所有资源,停止提供缓存
 /// </summary>
 public void Dispose()
 {
   _manager.Dispose();
   _manager = null;
 }