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

@@ -1,44 +1,22 @@
using System.Collections.Generic;
using System.ComponentModel;
using Newtonsoft.Json;
using Wox.Infrastructure.Storage;
using JsonProperty = Newtonsoft.Json.JsonPropertyAttribute;
namespace Wox.Plugin.Everything
{
public class ContextMenuStorage : JsonStrorage<ContextMenuStorage>
public class Settings
{
[JsonProperty] public List<ContextMenu> ContextMenus = new List<ContextMenu>();
public List<ContextMenu> ContextMenus = new List<ContextMenu>();
[JsonProperty]
public int MaxSearchCount { get; set; }
public IPublicAPI API { get; set; }
protected override string FileName { get; } = "EverythingContextMenu";
protected override void OnAfterLoad(ContextMenuStorage obj)
{
}
protected override ContextMenuStorage LoadDefault()
{
MaxSearchCount = 100;
return this;
}
public int MaxSearchCount { get; set; } = 100;
}
public class ContextMenu
{
[JsonProperty]
public string Name { get; set; }
[JsonProperty]
public string Command { get; set; }
[JsonProperty]
public string Argument { get; set; }
[JsonProperty]
public string ImagePath { get; set; }
}
}