private static void SetPort() { var ports = ComManager.ListComPorts(); if (ports.Count(x => x.EqualUsbVid) > 0) { ComManager.SetComPort(ports.First(x => x.EqualUsbVid).Name); } }
private void buttonOK_Click(object sender, EventArgs e) { if (comboPorts.SelectedIndex > -1) { ComManager.SetComPort(comboPorts.SelectedItem .ToString()); } Close(); }