private void Read() { while (true) { var answer = _reader.ReadLine(); Console.WriteLine("Answer: " + answer); MessageRecivedEvent?.Invoke(this, new ChatMessageEventArgs(answer)); } }
private void OnMessageRecived(MessageEventArgs e) { try { MessageRecivedEvent?.Invoke(this, e); CustomMessageRecivedEvent?.Invoke(e); } catch (Exception ex) { //log.Error(String.Format("PosID: {0}, {1}", e.UniqueID, ex)); } }
protected virtual void OnMessageRecived(MessageEventArgs e) { MessageRecivedEvent?.Invoke(this, e); }