private void _btnAddRegex_Click(object sender, System.EventArgs e) { using (RegexOptions dlg = new RegexOptions()) { if (dlg.ShowDialog(this) == DialogResult.OK) { LinkRegex linkRegex = LinkRegex.Create(); linkRegex.RegexMatch = dlg.RegexMatch; linkRegex.RegexReplace = dlg.RegexReplace; linkRegex.Save(); RefreshRegexList(linkRegex); } } }
private void _btnEditRegex_Click(object sender, EventArgs e) { LinkRegex item = (LinkRegex)_lbxRegexes.SelectedItem; using (RegexOptions dlg = new RegexOptions()) { dlg.RegexMatch = item.RegexMatch; dlg.RegexReplace = item.RegexReplace; if (dlg.ShowDialog(this) == DialogResult.OK) { item.RegexMatch = dlg.RegexMatch; item.RegexReplace = dlg.RegexReplace; item.Save(); RefreshRegexList(item); } } }