mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Save when exit
1. fix image cache 2. fix save when exit since destructor won't be called 3. fix #583 #582 (partially) #581 (partially) #580
This commit is contained in:
@@ -13,7 +13,7 @@ using Control = System.Windows.Controls.Control;
|
||||
|
||||
namespace Wox.Plugin.CMD
|
||||
{
|
||||
public class CMD : IPlugin, ISettingProvider, IPluginI18n, IInstantQuery, IContextMenu
|
||||
public class CMD : IPlugin, ISettingProvider, IPluginI18n, IContextMenu
|
||||
{
|
||||
private PluginInitContext context;
|
||||
private bool WinRStroked;
|
||||
|
||||
@@ -13,7 +13,7 @@ using Wox.Plugin.Everything.Everything;
|
||||
|
||||
namespace Wox.Plugin.Everything
|
||||
{
|
||||
public class Main : IPlugin, IPluginI18n, IContextMenu
|
||||
public class Main : IPlugin, IPluginI18n, IContextMenu, ISavable
|
||||
{
|
||||
private readonly EverythingAPI _api = new EverythingAPI();
|
||||
private static readonly List<string> ImageExts = new List<string> { ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".ico" };
|
||||
@@ -34,7 +34,7 @@ namespace Wox.Plugin.Everything
|
||||
_settings = _storage.Load();
|
||||
}
|
||||
|
||||
~Main()
|
||||
public void Save()
|
||||
{
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ using Wox.Infrastructure.Storage;
|
||||
|
||||
namespace Wox.Plugin.Folder
|
||||
{
|
||||
public class FolderPlugin : IPlugin, ISettingProvider, IPluginI18n
|
||||
public class FolderPlugin : IPlugin, ISettingProvider, IPluginI18n, ISavable
|
||||
{
|
||||
private static List<string> driverNames;
|
||||
private PluginInitContext context;
|
||||
@@ -23,7 +23,7 @@ namespace Wox.Plugin.Folder
|
||||
_settings = _storage.Load();
|
||||
}
|
||||
|
||||
~FolderPlugin()
|
||||
public void Save()
|
||||
{
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
|
||||
namespace Wox.Plugin.Program
|
||||
{
|
||||
public class Programs : ISettingProvider, IPlugin, IPluginI18n, IContextMenu
|
||||
public class Programs : ISettingProvider, IPlugin, IPluginI18n, IContextMenu, ISavable
|
||||
{
|
||||
private static object lockObject = new object();
|
||||
private static List<Program> _programs = new List<Program>();
|
||||
@@ -42,7 +42,7 @@ namespace Wox.Plugin.Program
|
||||
_cache = _cacheStorage.Load();
|
||||
}
|
||||
|
||||
~Programs()
|
||||
public void Save()
|
||||
{
|
||||
_settingsStorage.Save();
|
||||
_cacheStorage.Save();
|
||||
|
||||
@@ -9,7 +9,7 @@ using Wox.Plugin.WebSearch.SuggestionSources;
|
||||
|
||||
namespace Wox.Plugin.WebSearch
|
||||
{
|
||||
public class WebSearchPlugin : IPlugin, ISettingProvider, IPluginI18n, IInstantQuery, IMultipleActionKeywords
|
||||
public class WebSearchPlugin : IPlugin, ISettingProvider, IPluginI18n, IMultipleActionKeywords, ISavable
|
||||
{
|
||||
public PluginInitContext Context { get; private set; }
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Wox.Plugin.WebSearch
|
||||
_settings = _storage.Load();
|
||||
}
|
||||
|
||||
~WebSearchPlugin()
|
||||
public void Save()
|
||||
{
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user