/// <summary> /// Rebuilds the thumbnail cache. /// Old thumbnails will be kept until they are overwritten /// by new ones. /// </summary> public void Rebuild() { foreach (CacheItem item in thumbCache.Values) { item.State = CacheState.Unknown; } diskCache.Clear(); }
/// <summary> /// Clears the thumbnail cache. /// </summary> public void Clear(bool cleanDiskCache = false) { foreach (CacheItem item in thumbCache.Values) { item.Dispose(); } thumbCache.Clear(); if (rendererItem != null) { rendererItem.Dispose(); } rendererItem = null; bw.CancelAsync(); MemoryUsed = 0; MemoryUsedByRemoved = 0; removedItems.Clear(); processing.Clear(); processingRendererItem = Guid.Empty; // Empty persistent cache if (cleanDiskCache) { DiskCache.Clear(); } }