///<summary>停止</summary> ///<param name="isRefresh">是否刷新</param> private void Stop(bool isRefresh) { lock (this) { if (!m_IsStopped) { m_IsStopped = true; try { if (m_IsSimulator) { if (m_SerialPortSimulator != null) { m_SerialPortSimulator.Dispose(); m_SerialPortSimulator = null; } } else { m_SerialPort.Close(); } } catch { } if (isRefresh) { try { m_Handler.Clear(); } catch { } ChangeState(false); } } } }