private void buttonURLAdd_Click(object sender, EventArgs e) { List <string> all = new List <string>(); for (int i = 0; i < listView1.Items.Count; ++i) { all.Add(listView1.Items[i].Text); } KeeFoxURLForm kfurlf = new KeeFoxURLForm(false, false, null, null, all); if (kfurlf.ShowDialog() == DialogResult.OK) { //UpdateEntryStrings(false, false); //ResizeColumnHeaders(); if (kfurlf.Match && !kfurlf.RegEx) { listNormalURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && !kfurlf.RegEx) { listNormalBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Block" }); AddURLListItem(lvi); } if (kfurlf.Match && kfurlf.RegEx) { listRegExURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && kfurlf.RegEx) { listRegExBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Block" }); AddURLListItem(lvi); } UpdateURLStrings(); } }
private void buttonURLAdd_Click(object sender, EventArgs e) { List<string> all = new List<string>(); for (int i = 0; i < listView1.Items.Count; ++i) all.Add(listView1.Items[i].Text); KeeFoxURLForm kfurlf = new KeeFoxURLForm(false,false,null,null,all); if (kfurlf.ShowDialog() == DialogResult.OK) { //UpdateEntryStrings(false, false); //ResizeColumnHeaders(); if (kfurlf.Match && !kfurlf.RegEx) { listNormalURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && !kfurlf.RegEx) { listNormalBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Block" }); AddURLListItem(lvi); } if (kfurlf.Match && kfurlf.RegEx) { listRegExURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && kfurlf.RegEx) { listRegExBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Block" }); AddURLListItem(lvi); } UpdateURLStrings(); } }
private void buttonURLEdit_Click(object sender, EventArgs e) { ListView.SelectedListViewItemCollection lvsicSel = listView1.SelectedItems; List <string> all = new List <string>(); for (int i = 0; i < listView1.Items.Count; ++i) { all.Add(listView1.Items[i].Text); } for (int i = 0; i < lvsicSel.Count; ++i) { List <string> others = all.GetRange(0, all.Count); others.Remove(lvsicSel[i].Text); // find the current data KeeFoxURLForm kfurlf = null; if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Match") { kfurlf = new KeeFoxURLForm(true, false, null, lvsicSel[i].Text, others); } else if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Block") { kfurlf = new KeeFoxURLForm(false, true, null, lvsicSel[i].Text, others); } else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Match") { kfurlf = new KeeFoxURLForm(true, false, lvsicSel[i].Text, null, others); } else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Block") { kfurlf = new KeeFoxURLForm(false, true, lvsicSel[i].Text, null, others); } if (kfurlf.ShowDialog() == DialogResult.OK) { // remove the old URL data if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Match") { listNormalURLs.Remove(lvsicSel[i].Text); } else if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Block") { listNormalBlockedURLs.Remove(lvsicSel[i].Text); } else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Match") { listRegExURLs.Remove(lvsicSel[i].Text); } else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Block") { listRegExBlockedURLs.Remove(lvsicSel[i].Text); } RemoveURLListItem(lvsicSel[i]); //UpdateEntryStrings(false, false); //ResizeColumnHeaders(); if (kfurlf.Match && !kfurlf.RegEx) { listNormalURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && !kfurlf.RegEx) { listNormalBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Block" }); AddURLListItem(lvi); } if (kfurlf.Match && kfurlf.RegEx) { listRegExURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && kfurlf.RegEx) { listRegExBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Block" }); AddURLListItem(lvi); } UpdateURLStrings(); } } }
private void buttonURLEdit_Click(object sender, EventArgs e) { ListView.SelectedListViewItemCollection lvsicSel = listView1.SelectedItems; List<string> all = new List<string>(); for (int i = 0; i < listView1.Items.Count; ++i) all.Add(listView1.Items[i].Text); for (int i = 0; i < lvsicSel.Count; ++i) { List<string> others = all.GetRange(0, all.Count); others.Remove(lvsicSel[i].Text); // find the current data KeeFoxURLForm kfurlf = null; if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Match") kfurlf = new KeeFoxURLForm(true, false, null, lvsicSel[i].Text, others); else if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Block") kfurlf = new KeeFoxURLForm(false, true, null, lvsicSel[i].Text, others); else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Match") kfurlf = new KeeFoxURLForm(true, false, lvsicSel[i].Text, null, others); else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Block") kfurlf = new KeeFoxURLForm(false, true, lvsicSel[i].Text, null, others); if (kfurlf.ShowDialog() == DialogResult.OK) { // remove the old URL data if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Match") listNormalURLs.Remove(lvsicSel[i].Text); else if (lvsicSel[i].SubItems[1].Text == "Normal" && lvsicSel[i].SubItems[2].Text == "Block") listNormalBlockedURLs.Remove(lvsicSel[i].Text); else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Match") listRegExURLs.Remove(lvsicSel[i].Text); else if (lvsicSel[i].SubItems[1].Text == "RegEx" && lvsicSel[i].SubItems[2].Text == "Block") listRegExBlockedURLs.Remove(lvsicSel[i].Text); RemoveURLListItem(lvsicSel[i]); //UpdateEntryStrings(false, false); //ResizeColumnHeaders(); if (kfurlf.Match && !kfurlf.RegEx) { listNormalURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && !kfurlf.RegEx) { listNormalBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "Normal", "Block" }); AddURLListItem(lvi); } if (kfurlf.Match && kfurlf.RegEx) { listRegExURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Match" }); AddURLListItem(lvi); } if (kfurlf.Block && kfurlf.RegEx) { listRegExBlockedURLs.Add(kfurlf.URL); ListViewItem lvi = new ListViewItem(new string[] { kfurlf.URL, "RegEx", "Block" }); AddURLListItem(lvi); } UpdateURLStrings(); } } }