private void Form_Close(object sender, FormClosingEventArgs e) { if (m_UsbNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_UsbNotify); } if (usbDevice.State == DeviceState.Connected) { usbDevice.Close(); } }
protected void Form_Close(object sender, FormClosingEventArgs e) { rootHub.Close(); if (m_UsbNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_UsbNotify); } if (m_BthNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_BthNotify); } }
protected override void OnStop() { if (m_UsbNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_UsbNotify); } if (m_BthNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_BthNotify); } rootHub.Stop(); rootHub.Close(); EventLog.WriteEntry("Scarlet.Crush Productions DS3 Service Stopped", System.Diagnostics.EventLogEntryType.Information, 2); }
protected override void OnStop() { if (_mDs3Notify != IntPtr.Zero) { ScpDevice.UnregisterNotify(_mDs3Notify); } if (_mDs4Notify != IntPtr.Zero) { ScpDevice.UnregisterNotify(_mDs4Notify); } if (_mBthNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(_mBthNotify); } rootHub.Stop(); rootHub.Close(); Log.Info("Scarlet.Crush Productions DS3 Service Stopped"); }
private void Form_Close(object sender, FormClosingEventArgs e) { rootHub.Close(); if (m_Ds3Notify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_Ds3Notify); } if (m_Ds4Notify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_Ds4Notify); } if (m_BthNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(m_BthNotify); } if (_genericNotify != IntPtr.Zero) { ScpDevice.UnregisterNotify(_genericNotify); } }
/// <summary> /// Unregisters notifications. Can be used in form dispose /// </summary> /// <param name="hHandle">Handle returned from RegisterForUSBEvents</param> /// <returns>True if successful</returns> protected static bool UnregisterForUsbEvents(IntPtr hHandle) { return(ScpDevice.UnregisterNotify(hHandle)); }