private void btnUpdate_Click(object sender, EventArgs e) { if (SelectedMacro == null) { return; } MacroForm form = new MacroForm(SelectedMacro); var result = form.ShowDialog(); if (result == DialogResult.Cancel) { return; } //dito save new macro DataContext.Instance.SaveData(); RefreshBindings(); Refresh_Datagrid(); }
private void btnInsertMacro_Click(object sender, EventArgs e) { if (DataContext.Instance.SelectedMacroSet.Name == null) { MessageBox.Show("Select a Macro Set first."); return; } Macro newMacro = new Macro(); MacroForm form = new MacroForm(newMacro); var result = form.ShowDialog(); if (result == DialogResult.Cancel) { return; } //dito save new macro DataContext.Instance.SelectedMacroSet.InsertMacro(newMacro); DataContext.Instance.SaveData(); RefreshBindings(); Refresh_Datagrid(); }