// Add New Trigger (Right Click Context Menu) private void newStripMenuItem_Click(object sender, EventArgs e) { frmTrigger newTrigger = new frmTrigger(); if (newTrigger.ShowDialog() == DialogResult.OK) { ProfileEdited(); refresh_dgTriggers(); } // if() }
// Edit Trigger private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (dgTriggers.MultiSelect == true) { throw new NotImplementedException("Editing mutliple triggers at once is unsupported."); } foreach (DataGridViewRow row in this.dgTriggers.SelectedRows) { VI_Trigger selected_trigger = row.DataBoundItem as VI_Trigger; if (selected_trigger != null) { frmTrigger newTrigger = new frmTrigger(selected_trigger); if (newTrigger.ShowDialog() == DialogResult.OK) { ProfileEdited(); refresh_dgTriggers(); } // if() } } }