private void SetButtonstates()
{
bool hasSelected1 = lvConnectors.SelectedItems.Count > 0;
bool hasSelected2 = lvPorts.SelectedItems.Count > 0;
btnEditConnector.Visible = hasSelected1;
btnDeleteConnector.Visible = hasSelected1;
btnEditPort.Visible = hasSelected2;
btnDeletePort.Visible = hasSelected2;
}