2015-01-03 15:20:34 +08:00
|
|
|
|
using System.Windows;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
2016-06-24 05:53:30 +08:00
|
|
|
|
namespace Wox.Plugin.Shell
|
2014-07-04 15:34:31 +08:00
|
|
|
|
{
|
|
|
|
|
public partial class CMDSetting : UserControl
|
|
|
|
|
{
|
2016-05-19 16:04:31 +08:00
|
|
|
|
private readonly Settings _settings;
|
2016-03-28 10:09:57 +08:00
|
|
|
|
|
2016-05-19 16:04:31 +08:00
|
|
|
|
public CMDSetting(Settings settings)
|
2014-07-04 15:34:31 +08:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings = settings;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
|
|
|
|
|
{
|
2016-05-19 16:04:31 +08:00
|
|
|
|
ReplaceWinR.IsChecked = _settings.ReplaceWinR;
|
|
|
|
|
LeaveShellOpen.IsChecked = _settings.LeaveShellOpen;
|
|
|
|
|
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
|
2016-05-19 16:04:31 +08:00
|
|
|
|
LeaveShellOpen.Checked += (o, e) =>
|
2014-07-04 15:34:31 +08:00
|
|
|
|
{
|
2016-05-19 16:04:31 +08:00
|
|
|
|
_settings.LeaveShellOpen = true;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
};
|
|
|
|
|
|
2016-05-19 16:04:31 +08:00
|
|
|
|
LeaveShellOpen.Unchecked += (o, e) =>
|
2014-07-04 15:34:31 +08:00
|
|
|
|
{
|
2016-05-19 16:04:31 +08:00
|
|
|
|
_settings.LeaveShellOpen = false;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
};
|
|
|
|
|
|
2016-05-19 16:04:31 +08:00
|
|
|
|
ReplaceWinR.Checked += (o, e) =>
|
2014-07-04 15:34:31 +08:00
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.ReplaceWinR = true;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
};
|
2016-05-19 16:04:31 +08:00
|
|
|
|
ReplaceWinR.Unchecked += (o, e) =>
|
2014-07-04 15:34:31 +08:00
|
|
|
|
{
|
2016-03-28 10:09:57 +08:00
|
|
|
|
_settings.ReplaceWinR = false;
|
2014-07-04 15:34:31 +08:00
|
|
|
|
};
|
2016-05-19 16:04:31 +08:00
|
|
|
|
|
|
|
|
|
ShellComboBox.SelectedIndex = (int) _settings.Shell;
|
|
|
|
|
ShellComboBox.SelectionChanged += (o, e) =>
|
|
|
|
|
{
|
|
|
|
|
_settings.Shell = (Shell) ShellComboBox.SelectedIndex;
|
|
|
|
|
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
|
|
|
|
};
|
2014-07-04 15:34:31 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|