private void toolStripButtonDelAll_Click(object sender, EventArgs e) { try { if (lsvCacheCookie.Items.Count == 0) { return; } if (!AllForms.AskForConfirmation( "Proceed to delete all " + lsvCacheCookie.Items.Count.ToString() + " items?", this)) { return; } foreach (ListViewItem item in lsvCacheCookie.Items) { WinApis.DeleteUrlCacheEntry(item.SubItems[0].Text); } lsvCacheCookie.Items.Clear(); AdjustThisText(); } catch (Exception ee) { AllForms.m_frmLog.AppendToLog("toolStripButtonDelAll_Click:\r\n" + ee.ToString()); } }
private void toolStripButtonDelChecked_Click(object sender, EventArgs e) { try { ListView.CheckedListViewItemCollection checkeditems = lsvCacheCookie.CheckedItems; if (checkeditems.Count == 0) { return; } if (!AllForms.AskForConfirmation( "Proceed to delete " + checkeditems.Count.ToString() + " checked items?", this)) { return; } foreach (ListViewItem item in checkeditems) { WinApis.DeleteUrlCacheEntry(item.SubItems[0].Text); lsvCacheCookie.Items.Remove(item); } AdjustThisText(); } catch (Exception ee) { AllForms.m_frmLog.AppendToLog("toolStripButtonDelChecked_Click:\r\n" + ee.ToString()); } }