/// <summary> /// Event handler for arrival of devices /// </summary> /// <param name="sender"></param> /// <param name="devInterface">The device interface which was added</param> private void OnAdded(Windows.Devices.Enumeration.DeviceWatcher sender, Windows.Devices.Enumeration.DeviceInformation devInterface) { // search the device list for a device with a matching interface ID DeviceListEntry match = FindInList(devInterface.Id); // If we found a match then mark it as verified and return if (match != null) { if (match.Matched == false) { DeviceAdded(this, new UsbDeviceInfo(match)); } match.Matched = true; return; } // Create a new element for this device interface, and queue up the query of its // device information match = new DeviceListEntry(devInterface); // Add the new element to the end of the list of devices this.devices.Add(match); DeviceAdded(this, new UsbDeviceInfo(match)); }
internal UsbDeviceInfo(DeviceListEntry info) { Id = info.Id; Name = info.Name; }