Ejemplo n.º 1
0
        public UsbMonitor()
        {
            switch (HidSharp.PlatformDetector.RunningPlatform())
            {
            case HidSharp.PlatformDetector.Platform.Windows:
                winUsbDeviceMonitor = new WinUsbDeviceMonitor();
                winUsbDeviceMonitor.DeviceListChanged += HandleDeviceListChanged;
                break;

            case HidSharp.PlatformDetector.Platform.Linux:
                UsbDeviceNotifier = DeviceNotifier.OpenDeviceNotifier();
                UsbDeviceNotifier.OnDeviceNotify += OnDeviceNotifyEvent;
                break;
            }
        }
Ejemplo n.º 2
0
		public UsbMonitor ()
		{
            switch (HidSharp.PlatformDetector.RunningPlatform())
            {
                case HidSharp.PlatformDetector.Platform.Windows:
                    winUsbDeviceMonitor = new WinUsbDeviceMonitor();
                    winUsbDeviceMonitor.DeviceListChanged += HandleDeviceListChanged;
                    break;
                case HidSharp.PlatformDetector.Platform.Linux:
                    UsbDeviceNotifier = DeviceNotifier.OpenDeviceNotifier();
                    UsbDeviceNotifier.OnDeviceNotify += OnDeviceNotifyEvent;
                    break;
            }
		}