DisconnectDevice() public method

public DisconnectDevice ( DeviceForm devForm ) : bool
devForm DeviceForm
return bool
Exemplo n.º 1
0
 private void DeviceDisconnectionNotify(object sender, EventArgs e)
 {
     if (InvokeRequired)
     {
         try
         {
             Invoke((Delegate) new DeviceDisconnectionNotifyDelegate(DeviceConnectionNotify), sender, e);
         }
         catch { }
     }
     else
     {
         m_mutex.WaitOne();
         DeviceForm devForm = sender as DeviceForm;
         if (devForm != null)
         {
             comPortTreeForm.DisconnectDevice(devForm);
         }
         m_mutex.ReleaseMutex();
     }
 }