private void BtnAddNew_Click(object sender, EventArgs e) { using (var form = new LocalizationEditForm(Language, key => !string.IsNullOrWhiteSpace(key) && !_current.ContainsKey(key))) { if (form.ShowDialog() == DialogResult.OK) { _current.Add(form.Current.Key, form.Current); BindTable(); if (form.IsChanged) { IsChanged = true; } } UpdateControls(); } }
private void GvMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0 && gvMain.Rows[e.RowIndex].DataBoundItem is Localization localization) { var source = _sample != null && _sample.TryGetValue(localization.Key, out var sample) ? sample : null; using (var form = new LocalizationEditForm(localization, source, Language)) { if (form.ShowDialog() != DialogResult.Cancel) { if (form.IsChanged) { IsChanged = true; } } UpdateControls(); } } }