"景先生毕设|www.jxszl.com

C# CacheItem类代码示例

2023-12-29 17:37编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中CacheItem类的典型用法代码示例。如果您正苦于以下问题:C#CacheItem类的具体用法?C#CacheItem怎么用?C#CacheItem使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1: publicBitmapthis[ScannedImagescannedImage] { get { varnewState=scannedImage.GetThumbnailState(); if(cache.ContainsKey(scannedImage)) { //Cachehit varitem=cache[scannedImage]; if(item.State!=newState) { //Invalidated item.Thumbnail.Dispose(); item.Thumbnail=scannedImage.GetThumbnail(userConfigManager.Config.ThumbnailSize); item.State=newState; } returnitem.Thumbnail; } else { //Cachemiss varitem=newCacheItem { Thumbnail=scannedImage.GetThumbnail(userConfigManager.Config.ThumbnailSize), State=newState }; returnitem.Thumbnail; } } }
原文链接:http://www.jxszl.com/biancheng/C/556634.html