Esempio n. 1
0
 private void ExecuteRefreshAvailableCOMPortsCommand()
 {
     AvailableComPorts.Clear();
     foreach (var item in _serialPortManager.AvailablePorts)
     {
         AvailableComPorts.Add(item);
     }
 }
Esempio n. 2
0
        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);
            }
        }