[Programs] Fix MessageBox behaviour

Fix MessageBox asking user to select item if he clicks No after trying
to Delete an item in Programs Settings.
This commit is contained in:
Coenraad Stijne
2014-07-10 17:06:50 +02:00
parent ed2dc101bb
commit b91850262d

View File

@@ -35,12 +35,14 @@ namespace Wox.Plugin.SystemPlugins.Program
private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e) private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e)
{ {
ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource; ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource;
if (seletedProgramSource != null && if (seletedProgramSource != null)
MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource",
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{ {
UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource); if (MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource",
programSourceView.Items.Refresh(); MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource);
programSourceView.Items.Refresh();
}
} }
else else
{ {