/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { Win32Usb.UnregisterForUsbEvents(m_hUsbEventHandle); if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
/// <summary> /// Override called when the window handle has been created. /// </summary> /// <param name="e"></param> protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); m_hUsbEventHandle = Win32Usb.RegisterForUsbEvents(Handle, m_gDeviceClass); }