private void Receiver_ReceiveFinished(object sender, TelegramSocketReceivedEventArgs e) { // get last telegramData Telegram telegram = e.Telegram; if (telegram == null) { return; } // get parser from historyMap if (!_historyMap.ContainsKey(telegram.SerialNo)) { return; } var callback = _historyMap[telegram.SerialNo]; _historyMap.Remove(telegram.SerialNo); // null means the telegramData doesn't belong to this controller or no need to be parsed. if (callback == null) { return; } // involk callback callback(telegram); }
protected void OnReceiveFinished(TelegramSocketReceivedEventArgs e) { SafeRaise.Raise <TelegramSocketReceivedEventArgs>(ReceiveFinished, this, e); }