Exemplo n.º 1
0
        private void refreshDeviceList()
        {
            cboDevices.SelectedIndexChanged -= cboDevices_SelectedIndexChanged;
            mDevList          = UsbGlobals.DeviceList;
            tsNumDevices.Text = mDevList.Count.ToString();
            cboDevices.Sorted = false;
            cboDevices.Items.Clear();
            foreach (UsbDevice device in mDevList)
            {
                string sAdd = string.Format("Vid:0x{0:X4} Pid:0x{1:X4} {2} {3} {4}", device.Info.IdVendor, device.Info.IdProduct, device.Info.ManufacturerString, device.Info.ProductString, device.Info.SerialString);

                cboDevices.Items.Add(sAdd);
            }
            cboDevices.SelectedIndexChanged += cboDevices_SelectedIndexChanged;

            if (mDevList.Count == 0)
            {
                tsNumDevices.ForeColor = Color.Red;
                tvInfo.Nodes.Clear();
                tvInfo.Nodes.Add("No USB devices found.");
                tvInfo.Nodes.Add("A device must be installed which uses the LibUsb-Win32 driver.");
                tvInfo.Nodes.Add("Or");
                tvInfo.Nodes.Add("The LibUsb-Win32 kernel service must be enabled.");
            }
            else
            {
                tsNumDevices.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
            }
        }
Exemplo n.º 2
0
 private void cboDevice_DropDown(object sender, EventArgs e)
 {
     mDevList = UsbGlobals.DeviceList;
     cboDevice.Items.Clear();
     for (int i = 0; i < mDevList.Count; i++)
     {
         UsbDevice Device = mDevList[i];
         cboDevice.Items.Add(String.Format("Vendor:{0:X4} Product:{1:X4} {2}", Device.Info.IdVendor, Device.Info.IdProduct, Device.Info.ProductString));
     }
 }
Exemplo n.º 3
0
        private void refreshDeviceList()
        {
            cboDevices.SelectedIndexChanged -= cboDevices_SelectedIndexChanged;
            mDevList          = UsbGlobals.DeviceList;
            tsNumDevices.Text = mDevList.Count.ToString();
            cboDevices.Sorted = false;
            cboDevices.Items.Clear();
            foreach (UsbDevice device in mDevList)
            {
                string sAdd = string.Format("Vid:0x{0:X4} Pid:0x{1:X4} {2} {3} {4}", device.Info.IdVendor, device.Info.IdVendor, device.Info.ManufacturerString, device.Info.ProductString, device.Info.SerialString);
                cboDevices.Items.Add(sAdd);
            }
            cboDevices.SelectedIndexChanged += cboDevices_SelectedIndexChanged;

            if (mDevList.Count == 0)
            {
                tsNumDevices.ForeColor = Color.Red;
            }
            else
            {
                tsNumDevices.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
            }
        }