internal void Eraser() { //Debug.Print("StackPhl.Eraser") if (m_TypeConnect == EnumConnect.USB) { m_SerialPort_Int.Dispose(); m_SerialPort_Int.DataReceived -= new RoutinesLibrary.IO.SerialPort.DataReceivedEventHandler(SerialPort_Int_DataReceived); m_SerialPort_Int = null; } else if (m_TypeConnect == EnumConnect.TCP) { m_WinSockClient_Int.Dispose(); m_WinSockClient_Int.DataReceived -= new RoutinesLibrary.Net.Protocols.TCP.TCP.DataReceivedEventHandler(WinSockClient_Int_DataReceived); m_WinSockClient_Int.ClosedConnectionTCP -= new RoutinesLibrary.Net.Protocols.TCP.TCP.ClosedConnectionTCPEventHandler(WinSockClient_Int_ClosedConnection); m_WinSockClient_Int = null; } }
private void StopSearch() { m_Timer_Search.Interval = MS_WAIT_SEARCH; m_Timer_Search.Enabled = false; m_StatusConnect = StatusConnect.StopSearch; if (m_SerialPort_Int != null) { //m_SerialPort_Int.DataReceived -= new RoutinesLibrary.IO.SerialPort.DataReceivedEventHandler(SerialPort_Int_DataReceived); m_SerialPort_Int.Dispose(); } }