예제 #1
0
 public void Dispose()
 {
     if (_handle != null)
     {
         _handle.Dispose();
         _handle = null;
     }
 }
예제 #2
0
 private void OnDisconnected()
 {
     try
     {
         _disconnecting = true;
         IsConnected    = false;
         if (_deviceInterfaceFile != null)
         {
             _deviceInterfaceFile.Dispose();
             _deviceInterfaceFile = null;
             Thread.Sleep(500);
         }
         if (Disconnected != null)
         {
             Disconnected(this, new EventArgs());
         }
     }
     finally
     {
         _disconnecting = false;
     }
 }