private void ExecuteRefreshAvailableCOMPortsCommand() { AvailableComPorts.Clear(); foreach (var item in _serialPortManager.AvailablePorts) { AvailableComPorts.Add(item); } }
public void LoadAvailableComPorts() { string[] ports = SerialPort.GetPortNames(); var autoPort = (from p in ports where !p.Contains("COM1") select p); if (autoPort.Count() != 0) { SelectedComPort = autoPort.Last(); } foreach (var p in ports) { AvailableComPorts.Add(p); } }