public static void Stop() { _notifier.OnDeviceNotify -= HandleDeviceNotify; _notifier.Enabled = false; _notifier = null; UsbDevice.Exit(); UsbChanged = null; }
/// <summary> /// Upon construction, the USB notifier is started and an attempt is made to connect to a USB device. /// </summary> public Form1() { InitializeComponent(); // Bail if we are running inside of the Visual Studio designer view. // if (System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime) { return; } m_usbNotifier = LibUsbDotNet.DeviceNotify.DeviceNotifier.OpenDeviceNotifier(); m_usbNotifier.OnDeviceNotify += new EventHandler <LibUsbDotNet.DeviceNotify.DeviceNotifyEventArgs>(UsbNotifier_OnDeviceNotify); }
public static void Start() { _notifier = LibUsbDotNet.DeviceNotify.DeviceNotifier.OpenDeviceNotifier(); _notifier.OnDeviceNotify += HandleDeviceNotify; }