public ScalesConnectionEditorForm()
        {
            InitializeComponent();

            cbComPort.Items.Clear();
            cbComPort.Items.AddRange(SerialPortsEnumerator.Enumerate());
            cbComPort.Items.AddRange(SerialPortsEnumerator.EnumerateLPT());
        }
Example #2
0
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            List <string> ports = new List <string>();

            ports.AddRange(SerialPortsEnumerator.Enumerate());
            ports.AddRange(SerialPortsEnumerator.EnumerateLPT());

            return(new StandardValuesCollection(ports));
        }
Example #3
0
        /// <summary>
        /// Заполнение пула портов
        /// </summary>
        private void UpdateSerialPortsPool()
        {
            // заполняем пул портов
            var names = new List <string>();

            names.AddRange(SerialPortsEnumerator.Enumerate());
            names.AddRange(SerialPortsEnumerator.EnumerateLPT());
            foreach (string portName in names)
            {
                if (!_serialPortsPool.ContainsKey(portName))
                {
                    SerialPortsHelper helper = new SerialPortsHelper(portName);
                    _serialPortsPool.Add(portName, helper);
                }
            }
        }