Remove instance logic for BinaryStorage and JsonStorage, part 1

1. part of #389
2. huge refactoring
This commit is contained in:
bao-qian
2016-04-21 01:53:21 +01:00
parent 0bcb76fa81
commit 8d10c9aa41
52 changed files with 502 additions and 584 deletions

View File

@@ -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();
}
}