public void OnNewMessage(User nick, string message) { foreach (User n in Users) { if (nick.Nick == n.Nick) { OnMessage.Fire(this, new UserMessageEventArgs(n, message)); break; } } }
void m_queue_DataOnQueueChanged(object sender, EventArgs e) { var msg = new TraceMessage(m_serializer); try { Thread.Sleep(100); var result = m_queue.Receive(msg); if (result == ReadWriteResult.OK) { OnMessage.Fire(this, new GenericEventArgs <TraceMessage>(msg)); } } catch (Exception ex) { } }