mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Remove instance logic for BinaryStorage and JsonStorage, part 1
1. part of #389 2. huge refactoring
This commit is contained in:
@@ -5,6 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Wox.Infrastructure.Storage;
|
||||
|
||||
namespace Wox.Plugin.Folder
|
||||
{
|
||||
@@ -12,7 +13,20 @@ namespace Wox.Plugin.Folder
|
||||
{
|
||||
private static List<string> driverNames;
|
||||
private PluginInitContext context;
|
||||
private FolderStorage _settings = FolderStorage.Instance;
|
||||
|
||||
private readonly Settings _settings;
|
||||
private readonly PluginSettingsStorage<Settings> _storage;
|
||||
|
||||
public FolderPlugin()
|
||||
{
|
||||
_storage = new PluginSettingsStorage<Settings>();
|
||||
_settings = _storage.Load();
|
||||
}
|
||||
|
||||
~FolderPlugin()
|
||||
{
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
public Control CreateSettingPanel()
|
||||
{
|
||||
@@ -26,7 +40,6 @@ namespace Wox.Plugin.Folder
|
||||
if (_settings.FolderLinks == null)
|
||||
{
|
||||
_settings.FolderLinks = new List<FolderLink>();
|
||||
_settings.Save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user