private void addButton_Click(object sender, EventArgs e) { FormEditRule FormEditRule = new FormEditRule(null); if (FormEditRule.ShowDialog() == DialogResult.OK) { Configuration.GetConfig().Rules.Add(FormEditRule.Rule); this.SaveConfigAndRefresh(); } }
private void editButton_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count > 0) { FirewallRule usb = (FirewallRule)this.dataGridView1.SelectedRows[0].DataBoundItem; FormEditRule FormEditRule = new FormEditRule(usb); if (FormEditRule.ShowDialog() == DialogResult.OK) { this.SaveConfigAndRefresh(); } } }