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

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Controls;
using Wox.Infrastructure.Storage;
using Wox.Plugin.WebSearch.Annotations;
using Wox.Plugin.WebSearch.SuggestionSources;
@@ -10,9 +11,22 @@ namespace Wox.Plugin.WebSearch
{
public class WebSearchPlugin : IPlugin, ISettingProvider, IPluginI18n, IInstantQuery, IMultipleActionKeywords
{
private WebSearchStorage _settings = WebSearchStorage.Instance;
public PluginInitContext Context { get; private set; }
private readonly PluginSettingsStorage<Settings> _storage;
private readonly Settings _settings;
public WebSearchPlugin()
{
_storage = new PluginSettingsStorage<Settings>();
_settings = _storage.Load();
}
~WebSearchPlugin()
{
_storage.Save();
}
public List<Result> Query(Query query)
{
List<Result> results = new List<Result>();