private void _port_Click(object sender, EventArgs e) { string __port = config.Port.ToString(); if (Utility.ShowInputDialog(ref __port, "Enter new IP") == DialogResult.OK) { var p = int.Parse(__port); if (p >= 0 && p <= 65535) { config.Port = p; config.Validate(); config.SaveConfig(); Log(NotificationType.PortUpdated, p); } } }