private void buttonAddNew_Click(object sender, RoutedEventArgs e) { DialogInput dialogInput = new DialogInput("Please enter new language file:", ".json"); dialogInput.Owner = this; if (dialogInput.ShowDialog() == true) { string fileName = dialogInput.Answer; LocalizationManager.GetInstance().AddLanguage(fileName); } Reload(); }
/**********************************************************/ private void AddNew() { DialogInput dialogInput = new DialogInput("Please enter new key:"); dialogInput.Owner = this; if (dialogInput.ShowDialog() == true) { string key = dialogInput.Answer; ListViewEntry listViewEntry = LocalizationManager.GetInstance().AddKey(key); listView.SelectedItem = listViewEntry; listView.ScrollIntoView(listViewEntry); } }
private void RenameSelected() { ListViewEntry entry = (ListViewEntry)listView.SelectedItem; if (entry != null) { DialogInput dialogInput = new DialogInput("Rename Key", entry.Key); dialogInput.Owner = this; if (dialogInput.ShowDialog() == true) { string key = dialogInput.Answer; bool result = LocalizationManager.GetInstance().RenameKey(entry.Key, key); if (result == false) { MessageBox.Show("The key already exists", "Could not rename key", MessageBoxButton.OK, MessageBoxImage.Error); } } } }
private void buttonRename_Click(object sender, RoutedEventArgs e) { string entry = (string)listView.SelectedItem; if (entry != null) { DialogInput dialogInput = new DialogInput("Rename language", entry); dialogInput.Owner = this; if (dialogInput.ShowDialog() == true) { string key = dialogInput.Answer; bool result = LocalizationManager.GetInstance().RenameLangauge(entry, key); if (result == false) { MessageBox.Show("The language already exists!", "Could not rename", MessageBoxButton.OK, MessageBoxImage.Error); } Reload(); } } }