mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Remove instance logic for BinaryStorage and JsonStorage, part 1
1. part of #389 2. huge refactoring
This commit is contained in:
@@ -6,14 +6,12 @@ using Wox.Infrastructure.Storage;
|
||||
namespace Wox.ImageLoader
|
||||
{
|
||||
[Serializable]
|
||||
public class ImageCacheStroage : BinaryStorage<ImageCacheStroage>
|
||||
public class ImageCache
|
||||
{
|
||||
private int counter;
|
||||
private const int maxCached = 200;
|
||||
public Dictionary<string, int> TopUsedImages = new Dictionary<string, int>();
|
||||
|
||||
protected override string FileName { get; } = "ImageCache";
|
||||
|
||||
public void Add(string path)
|
||||
{
|
||||
if (TopUsedImages.ContainsKey(path))
|
||||
@@ -35,7 +33,6 @@ namespace Wox.ImageLoader
|
||||
if (++counter == 30)
|
||||
{
|
||||
counter = 0;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user