通过另一个函数将参数传递给SerialDataReceivedEventHandler

时间:2014-02-26 11:03:29

标签: c#

如何让这个工作起来.... 我试图将事件处理程序传递给处理回调的函数。 .............主要例程............

    ConnectPorts(DataReceivedHandlerFREQ_FL );

......................................

.............函数被调用来设置事件处理程序..........

    static void ConnectPort(???? DataReceivedHandlerFREQ_FL)
    {
            SerialPort FLfreqPort = new SerialPort(MyGlobals.ComPortFLFQ, 153600);
            FLfreqPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandlerFREQ_FL);
    }

............................................... ................

..........................处理程序在这里定义................ ........

    private static void DataReceivedHandlerRFID_FL(object sender, SerialDataReceivedEventArgs e)
    {
            DataReceivedHandlerRFID(sender,  e, 0);
     }

0 个答案:

没有答案