// �L���b�V���폜(�ꗗ�\������̂Ăяo�����) public bool Remove(CacheKind cacheKind, string hostName, int port, string uri) { // �r������ lock (this) { if (cacheKind == CacheKind.Memory && _memoryCache != null) { return(_memoryCache.Remove(hostName, port, uri)); } if (cacheKind == CacheKind.Disk && _diskCache != null) { return(_diskCache.Remove(hostName, port, uri)); } } return(false); }
// �L���b�V����Ԏ擾 public long GetInfo(CacheKind cacheKind, ref List <CacheInfo> infoList) { if (cacheKind == CacheKind.Memory) //������ { if (_memoryCache != null) { return(_memoryCache.GetInfo(ref infoList, 0, this)); } } else //�f�B�X�N { if (_diskCache != null) { return(_diskCache.GetInfo(ref infoList, 0, this)); } } return(0); }
public static void DeleteCache(CacheKind kind) { if (Interlocked.Exchange(ref Locker, 1) == 0) { try { var proc = Process.Start(new ProcessStartInfo("cmd.exe") { CreateNoWindow = true, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false }); proc.StandardInput.WriteLine("rundll32.exe InetCpl.cpl,ClearMyTracksByProcess {0}", (int)kind); proc.StandardInput.WriteLine("exit"); } finally { Interlocked.Exchange(ref Locker, 0); } } }
//メモリ一覧 void FuncMemory() { _kind = CacheKind.Memory; Cmd("Refresh-MemoryCache"); }
//ディスク一覧 void FuncDisk() { _kind = CacheKind.Disk; Cmd("Refresh-DiskCache"); }
protected CacheBase(CacheKind kind, Logger logger) { _kind = kind; _logger = logger; Length = 0;//現在キャッシュに保持しているデータ量 }
// �L���b�V���폜(�ꗗ�\������̂Ăяo�����) public bool Remove(CacheKind cacheKind, string hostName, int port, string uri) { // �r������ lock (this) { if (cacheKind == CacheKind.Memory && _memoryCache != null) return _memoryCache.Remove(hostName, port, uri); if (cacheKind == CacheKind.Disk && _diskCache != null) return _diskCache.Remove(hostName, port, uri); } return false; }
// �L���b�V����Ԏ擾 public long GetInfo(CacheKind cacheKind, ref List<CacheInfo> infoList) { if (cacheKind == CacheKind.Memory) {//������ if (_memoryCache != null) return _memoryCache.GetInfo(ref infoList, 0, this); } else {//�f�B�X�N if (_diskCache != null) return _diskCache.GetInfo(ref infoList, 0, this); } return 0; }
readonly CacheKind _kind;//キャッシュの種類 protected CacheBase(CacheKind kind, Logger logger) { _kind = kind; _logger = logger; Length = 0;//現在キャッシュに保持しているデータ量 }