示例#1
0
文件: Prefetch.cs 项目: n0tzy/Typict
 public void InsertImage(Data.GroupingElement elem)
 {
     imageQueue.Insert(elem);
     while (imageQueue.Count > Core.Config.BehaviorConfig.PrefetchConfig.PrefetchKeepMaximum)
     {
         var deq = imageQueue.Pop();
         if (!deq.IsBuffered)
         {
             continue;
         }
         try
         {
             deq.BufferedImage.Dispose();
         }
         finally
         {
             deq.BufferedImage = null;
         }
     }
 }
示例#2
0
文件: Prefetch.cs 项目: n0tzy/Typict
 public void InsertThumbnail(Data.GroupingElement elem)
 {
     thumbnailQueue.Insert(elem);
     if (Core.Config.BehaviorConfig.PrefetchConfig.KeepAllThumbnail)
     {
         return;
     }
     while (imageQueue.Count > Core.Config.BehaviorConfig.PrefetchConfig.ThumbnailKeepMaximum)
     {
         var deq = thumbnailQueue.Pop();
         if (!deq.IsBuffered)
         {
             continue;
         }
         try
         {
             deq.BufferedImage.Dispose();
         }
         finally
         {
             deq.BufferedImage = null;
         }
     }
 }