Jinjinov/Usb.Events

UsbDriveMounted and UsbDriveEjected events should be members of UsbDevice

sonicbhoc opened this issue · 0 comments

While raising UsbDeviceAdded and UsbDeviceRemoved events from the UsbEventWatcher makes sense since it controls devices, raising events that affect an individual UsbDevice from the UsbEventWatcher seems to be breaking encapsulation.

A feasible solution would be to have the UsbDriveMounted and UsbDriveEjected events instead be IObservables associated with specific UsbDevices, and have the UsbEventWatcher automatically subscribe to the IObservables when new devices are added. This allows for both the current behavior of watching changes on currently watched devices, and allows for watching mount point changes for an individual device.