private void deletePersonalityClicked(object sender, RoutedEventArgs e) { string messageBoxText = "Are you sure you want to delete the \"" + Personality.Name + "\" personality?"; string caption = "Delete Personality"; MessageBoxResult result = MessageBox.Show(messageBoxText, caption, MessageBoxButton.YesNo, MessageBoxImage.Warning); switch (result) { case MessageBoxResult.Yes: // Remove the personality from the list and the local filesystem Personality oldPersonality = Personality; Personalities.Remove(oldPersonality); Personality = Personalities[0]; oldPersonality.RemoveFile(); break; } }
private void deletePersonalityClicked(object sender, RoutedEventArgs e) { EDDI.Instance.SpeechResponderModalWait = true; string messageBoxText = string.Format(Properties.SpeechResponder.delete_personality_message, Personality.Name); string caption = Properties.SpeechResponder.delete_personality_caption; MessageBoxResult result = MessageBox.Show(messageBoxText, caption, MessageBoxButton.YesNo, MessageBoxImage.Warning); switch (result) { case MessageBoxResult.Yes: // Remove the personality from the list and the local filesystem Personality oldPersonality = Personality; Personalities.Remove(oldPersonality); Personality = Personalities[0]; oldPersonality.RemoveFile(); break; } EDDI.Instance.SpeechResponderModalWait = false; }