public bool RemovePort(string portName)
{
bool flag = true;
treeViewUtils.RemoveTextFromTree(tvPorts, portName);
return flag;
}
private void tsmiCloseDevice_Click(object sender, EventArgs e) { m_mutex.WaitOne(); DeviceForm activeDeviceForm = GetActiveDeviceForm(); if (activeDeviceForm != null) { activeDeviceForm.DeviceFormClose(true); activeDeviceForm.Close(); comPortTreeForm.RemovePort(activeDeviceForm.devInfo.ComPortInfo.ComPort); } comPortTreeForm.FindNodeToOpen(); m_mutex.ReleaseMutex(); }