private void btnIncludeAdd_Click(object sender, EventArgs e) { using (var f = new XmlReplacementEditForm()) { if (f.ShowDialog(this) == DialogResult.OK) { this.Add(f.Value); } } }
private void btnIncludeEdit_Click(object sender, EventArgs e) { if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0) { var lvi = this.listView2.SelectedItems[0]; if (lvi != null) { var rule = lvi.Tag as XmlReplacementRule; if (rule != null) { using (var f = new XmlReplacementEditForm()) { f.Value = rule; if (f.ShowDialog(this) == DialogResult.OK) { this.PopulateListView(lvi, rule); } } } } } }