Пример #1
0
 public Boolean UsbDeviceIsPresent(UsbDeviceInformation device)
 {
     foreach (UsbDeviceInformation deviceInList in devices)
     {
         if (device.Equals(deviceInList))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
 public void RemoveUsbDevice(UsbDeviceInformation device)
 {
     for (int i = 0; i < devices.Count; i++)
     {
         if (device.Equals(devices[i]))
         {
             devices.RemoveAt(i);
             return;
         }
     }
     throw new InvalidOperationException(String.Format("Device {0} is not present", device));
 }