private void CmbIP4AddressUsed_SelectedIndexChanged(object sender, EventArgs e) { var ipAddress = (IPAddress)cmbIP4AddressUsed.SelectedItem; if (ipAddress?.ToString() != previousIpAddress?.ToString()) { applicationLogic.ChangeIPAddressUsed(ipAddress); } previousIpAddress = ipAddress; }