public static (DialogResult res, LabelEditorForm form) GoEdit(LogLabel lb) { LabelEditorForm form = new LabelEditorForm(lb); var res = form.ShowDialog(); return(res, form); }
public static (DialogResult res, LabelEditorForm form) GoCreate(string profileName) { var form = new LabelEditorForm(profileName); var res = form.ShowDialog(); return(res, form); }
private async void btEdit_Click(object sender, EventArgs e) { var(res, form) = LabelEditorForm.GoEdit(data); if (res == DialogResult.OK) { await _controller.UpdateLabel(form.Result); RaiseOnDataDirty(); } }
private async void addButton_Click(object sender, EventArgs e) { if (_selectedProfile == PROFILES_ALL_NAME) { MessageBox.Show("Select profile first"); return; } var(res, form) = LabelEditorForm.GoCreate(_selectedProfile); if (res == DialogResult.OK) { await _controller.AddLabel(form.Result); RefreshDataInAdapter(); //adapter.UpdateData(_state.Labels); } }