mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Use variable instead of global static method
1. introduce variable 2. part of #389 3. refactoring program suffix in program plugin 4. 全局变量一时爽,代码重构火葬场
This commit is contained in:
@@ -10,11 +10,13 @@ namespace Wox
|
||||
public partial class ActionKeywords : Window
|
||||
{
|
||||
private PluginPair _plugin;
|
||||
private UserSettingStorage _settings;
|
||||
|
||||
public ActionKeywords(string pluginId)
|
||||
public ActionKeywords(string pluginId, UserSettingStorage settings)
|
||||
{
|
||||
InitializeComponent();
|
||||
_plugin = PluginManager.GetPluginForId(pluginId);
|
||||
_settings = settings;
|
||||
if (_plugin == null)
|
||||
{
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("cannotFindSpecifiedPlugin"));
|
||||
@@ -48,7 +50,7 @@ namespace Wox
|
||||
return;
|
||||
}
|
||||
// update persistant data
|
||||
UserSettingStorage.Instance.UpdateActionKeyword(_plugin.Metadata);
|
||||
_settings.UpdateActionKeyword(_plugin.Metadata);
|
||||
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed"));
|
||||
Close();
|
||||
|
||||
Reference in New Issue
Block a user