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

@@ -10,11 +10,11 @@ namespace Wox.Plugin.WebSearch
/// </summary>
public partial class WebSearchesSetting : UserControl
{
private WebSearchStorage _settings;
private Settings _settings;
public PluginInitContext Context { get; }
public WebSearchPlugin Plugin { get; }
public WebSearchesSetting(WebSearchPlugin plugin, WebSearchStorage settings)
public WebSearchesSetting(WebSearchPlugin plugin, Settings settings)
{
Context = plugin.Context;
Plugin = plugin;
@@ -97,14 +97,12 @@ namespace Wox.Plugin.WebSearch
{
comboBoxSuggestionSource.Visibility = Visibility.Visible;
_settings.EnableWebSearchSuggestion = true;
_settings.Save();
}
private void CbEnableWebSearchSuggestion_OnUnchecked(object sender, RoutedEventArgs e)
{
comboBoxSuggestionSource.Visibility = Visibility.Collapsed;
_settings.EnableWebSearchSuggestion = false;
_settings.Save();
}
private void ComboBoxSuggestionSource_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -112,7 +110,6 @@ namespace Wox.Plugin.WebSearch
if (e.AddedItems.Count > 0)
{
_settings.WebSearchSuggestionSource = ((ComboBoxItem)e.AddedItems[0]).Content.ToString();
_settings.Save();
}
}
}