private void btnRemove_Click(object sender, EventArgs e) { if (slvPortMappings.SelectedItems.Count < 1) { return; } PortMappingEntry entry = (PortMappingEntry)slvPortMappings.SelectedItems[0].Tag; entry.RemoveFromMapping(); }
private void btnRemove_Click(object sender, EventArgs e) { if (slvPortMappings.SelectedItems.Count < 1) { return; } PortMappingEntry entry = (PortMappingEntry)slvPortMappings.SelectedItems[0].Tag; try { entry.RemoveFromMapping(); } catch { MetroMessageBox.Show(this, "Error during rule removal", "This rule couldn't be removed. Try removing it from the router's webinterface."); } }