private void SoftDisconnect() { /* A 'soft disconnect' is where we don't want to record any more events, but we do want to * finish decoding as much of the data as possible before pulling the plug to the device. */ if (m_session != null) { buttonConnect.Enabled = false; m_session.OnDisconnect += SoftDisconnectDone; m_session.Disconnect(); } }