PowerToys/Plugins/Wox.Plugin.Program/ProgramSuffixes.xaml.cs

37 lines
1.2 KiB
C#
Raw Normal View History

using System.Windows;
using System.Linq;
namespace Wox.Plugin.Program
{
/// <summary>
/// ProgramSuffixes.xaml 的交互逻辑
/// </summary>
public partial class ProgramSuffixes
{
2015-01-06 23:24:11 +08:00
private PluginInitContext context;
private ProgramStorage _settings;
2015-01-06 23:24:11 +08:00
public ProgramSuffixes(PluginInitContext context, ProgramStorage settings)
{
2015-01-06 23:24:11 +08:00
this.context = context;
InitializeComponent();
_settings = settings;
tbSuffixes.Text = string.Join(ProgramSource.SuffixSeperator.ToString(), _settings.ProgramSuffixes);
}
2014-08-14 19:45:48 +08:00
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
2014-08-14 19:45:48 +08:00
if (string.IsNullOrEmpty(tbSuffixes.Text))
{
2015-01-06 23:24:11 +08:00
string warning = context.API.GetTranslation("wox_plugin_program_suffixes_cannot_empty");
MessageBox.Show(warning);
2014-08-14 19:45:48 +08:00
return;
}
_settings.ProgramSuffixes = tbSuffixes.Text.Split(ProgramSource.SuffixSeperator);
2015-01-06 23:24:11 +08:00
string msg = context.API.GetTranslation("wox_plugin_program_update_file_suffixes");
MessageBox.Show(msg);
}
}
}