/// <summary> /// Initializes a new instance of the <see cref="ImageListViewCacheThumbnail"/> class. /// </summary> /// <param name="owner">The owner control.</param> public ImageListViewCacheThumbnail(ImageListView owner) { context = null; bw = new QueuedBackgroundWorker(); bw.ProcessingMode = ProcessingMode.LIFO; bw.IsBackground = true; bw.ThreadName = "Thumbnail Cache Worker Thread"; bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += bw_RunWorkerCompleted; checkProcessingCallback = new SendOrPostCallback(CanContinueProcessing); mImageListView = owner; diskCache = new PersistentCache(); diskCache.Size = 100 * 1024 * 1024; // 100 MB disk cache CacheMode = CacheMode.OnDemand; CacheLimitAsItemCount = 0; CacheLimitAsMemory = 20 * 1024 * 1024; RetryOnError = false; thumbCache = new Dictionary <Guid, CacheItem>(); editCache = new Dictionary <Guid, bool>(); processing = new Dictionary <Guid, bool>(); processingRendererItem = Guid.Empty; processingGalleryItem = Guid.Empty; rendererItem = null; galleryItem = null; MemoryUsed = 0; MemoryUsedByRemoved = 0; removedItems = new List <Guid>(); disposed = false; }
/// <summary> /// Initializes a new instance of the <see cref="ImageListViewCacheThumbnail"/> class. /// </summary> /// <param name="owner">The owner control.</param> public ImageListViewCacheThumbnail(ImageListView owner) { context = null; bw = new QueuedBackgroundWorker(); bw.ProcessingMode = ProcessingMode.LIFO; bw.IsBackground = true; bw.ThreadName = "Thumbnail Cache Worker Thread"; bw.DoWork += bw_DoWork; bw.RunWorkerCompleted += bw_RunWorkerCompleted; checkProcessingCallback = new SendOrPostCallback(CanContinueProcessing); mImageListView = owner; diskCache = new PersistentCache(); diskCache.Size = 100 * 1024 * 1024; // 100 MB disk cache CacheMode = CacheMode.OnDemand; CacheLimitAsItemCount = 0; CacheLimitAsMemory = 20 * 1024 * 1024; RetryOnError = false; thumbCache = new Dictionary<Guid, CacheItem>(); editCache = new Dictionary<Guid, bool>(); processing = new Dictionary<Guid, bool>(); processingRendererItem = Guid.Empty; processingGalleryItem = Guid.Empty; rendererItem = null; galleryItem = null; MemoryUsed = 0; MemoryUsedByRemoved = 0; removedItems = new List<Guid>(); disposed = false; }