Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
 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;
     }
 }