public TestClass() { SerialComPort port = new SerialComPort(); port.IncomingData += new IncomingDataEventHandler(port_IncomingData); port.SendingData += new SendingDataEventHandler(port_SendingData); port.ErrorData += new ErrorDataEventHandler(port_ErrorData); }