Esempio n. 1
0
        private void RaisePduErrorEvent(PDUException exception, byte[] byteDump, PDUHeader header, PDU pdu)
        {
            if (PDUError == null)
            {
                return;
            }
            PDUErrorEventArgs e = new PDUErrorEventArgs(exception, byteDump, header, pdu);

            foreach (EventHandler <PDUErrorEventArgs> del in PDUError.GetInvocationList())
            {
                del.BeginInvoke(this, e, AsyncCallBackRaisePduErrorEvent, del);
            }
        }
Esempio n. 2
0
        private void RaisePduErrorEvent(PDUException exception, byte[] byteDump, PDUHeader header, PDU pdu)
        {
            if (PDUError == null)
            {
                return;
            }
            PDUErrorEventArgs e = new PDUErrorEventArgs(exception, byteDump, header, pdu);

            foreach (EventHandler <PDUErrorEventArgs> del in PDUError.GetInvocationList())
            {
#if NET40
                del.BeginInvoke(this, e, AsyncCallBackRaisePduErrorEvent, del);
#else
                System.Threading.Tasks.Task.Run(() => del.Invoke(this, e));
#endif
            }
        }