Пример #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;
            }
        }
Пример #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;
            }
		}