Revert "[PowerToys Run] Update to net5 (#12434)" (#12543)

This reverts commit c651a4b36e.
This commit is contained in:
Mykhailo Pylyp
2021-07-28 14:15:47 +03:00
committed by GitHub
parent 0c02a9acd7
commit 9731cdee67
58 changed files with 402 additions and 180 deletions

View File

@@ -29,6 +29,7 @@ namespace Wox.Infrastructure.Image
private static readonly ImageCache ImageCache = new ImageCache();
private static readonly ConcurrentDictionary<string, string> GuidToKey = new ConcurrentDictionary<string, string>();
private static BinaryStorage<Dictionary<string, int>> _storage;
private static IImageHashGenerator _hashGenerator;
public static string ErrorIconPath { get; set; }
@@ -48,8 +49,9 @@ namespace Wox.Infrastructure.Image
public static void Initialize(Theme theme)
{
_storage = new BinaryStorage<Dictionary<string, int>>("Image");
_hashGenerator = new ImageHashGenerator();
ImageCache.Initialize();
ImageCache.SetUsageAsDictionary(_storage.TryLoad(new Dictionary<string, int>()));
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon, Constant.LightThemedDefaultIcon, Constant.LightThemedErrorIcon })
{
@@ -76,7 +78,7 @@ namespace Wox.Infrastructure.Image
public static void Save()
{
ImageCache.Cleanup();
ImageCache.Save();
_storage.Save(ImageCache.GetUsageAsDictionary());
}
// Todo : Update it with icons specific to each theme.