/// <summary> /// Shows the EditStringForm for a certain listview /// </summary> void ShowEditForm(ListView listView) { if (listView.SelectedItems.Count > 0) { ListViewItem item = listView.SelectedItems[0]; long stringId = Convert.ToInt32(item.SubItems[0].Text); EditStringForm form = new EditStringForm(); form.Translated = item.SubItems[1].Text; form.Original = item.SubItems[2].Text; if (form.ShowDialog(this) == DialogResult.Cancel) { return; } TranslatorItem translatorItem = null; TranslationManager.Instance.All.GetItemById(stringId, ref translatorItem); if (translatorItem == null) { return; } if (form.Translated == "") { translatorItem.State = TranslationState.Untranslated; } else { translatorItem.State = TranslationState.Translated; } translatorItem.StringTranslated.Text = form.Translated; } }
/// <summary> /// Shows the EditStringForm for a certain listview /// </summary> void ShowEditForm(ListView listView) { if (listView.SelectedItems.Count>0) { ListViewItem item=listView.SelectedItems[0]; long stringId=Convert.ToInt32(item.SubItems[0].Text); EditStringForm form=new EditStringForm(); form.Translated=item.SubItems[1].Text; form.Original=item.SubItems[2].Text; if (form.ShowDialog(this)==DialogResult.Cancel) return; TranslatorItem translatorItem=null; TranslationManager.Instance.All.GetItemById(stringId, ref translatorItem); if (translatorItem==null) return; if (form.Translated=="") translatorItem.State=TranslationState.Untranslated; else translatorItem.State=TranslationState.Translated; translatorItem.StringTranslated.Text=form.Translated; } }