Refactoring image cache

use parallel linq to preload images, should be faster
This commit is contained in:
bao-qian
2016-04-21 23:37:40 +01:00
parent 80f31f75ad
commit 03051a95cf
7 changed files with 48 additions and 62 deletions

View File

@@ -23,7 +23,7 @@ namespace Wox
{
private const string Unique = "Wox_Unique_Application_Mutex";
public static MainWindow Window { get; private set; }
public static ImageLoader.ImageLoader ImageLoader;
public static PublicAPIInstance API { get; private set; }
[STAThread]
@@ -48,7 +48,9 @@ namespace Wox
ThreadPool.SetMaxThreads(30, 10);
ThreadPool.SetMinThreads(10, 5);
ThreadPool.QueueUserWorkItem(_ => { ImageLoader.ImageLoader.PreloadImages(); });
ImageLoader = new ImageLoader.ImageLoader();
ThreadPool.QueueUserWorkItem(_ => { ImageLoader.PreloadImages(); });
PluginManager.Initialize();