internal void HandleDisconnection(DisconnectionReason reason) { if (isConnected) { var args = new DisconnectionEventArgs(reason); if (DisconnectionReason.DeviceRemoved != reason && OnDisconnecting != null) { OnDisconnecting(this, args); } if (OnDisconnected != null) { OnDisconnected(this, args); } isConnected = false; } }
internal void HandleDisconnection(DisconnectionReason reason) { if (isConnected) { var args = new DisconnectionEventArgs(reason); if (DisconnectionReason.DeviceRemoved != reason && OnDisconnecting != null) OnDisconnecting(this, args); if (OnDisconnected != null) OnDisconnected(this, args); isConnected = false; } }