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

@@ -7,7 +7,6 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;
using Wox.Infrastructure.Storage;
using Wox.Plugin;
namespace Wox.Infrastructure.Image
@@ -20,16 +19,8 @@ namespace Wox.Infrastructure.Image
private readonly ConcurrentDictionary<string, ImageSource> _data = new ConcurrentDictionary<string, ImageSource>();
[NonSerialized]
private readonly WoxJsonStorage<ConcurrentDictionary<string, int>> _usageStorage;
public ConcurrentDictionary<string, int> Usage { get; private set; } = new ConcurrentDictionary<string, int>();
public ImageCache()
{
_usageStorage = new WoxJsonStorage<ConcurrentDictionary<string, int>>("ImageUsageCache");
}
public ImageSource this[string path]
{
get
@@ -96,14 +87,9 @@ namespace Wox.Infrastructure.Image
return new Dictionary<string, int>(Usage);
}
public void Initialize()
public void SetUsageAsDictionary(Dictionary<string, int> usage)
{
Usage = _usageStorage.Load();
}
public void Save()
{
_usageStorage.Save();
Usage = new ConcurrentDictionary<string, int>(usage);
}
}
}