/// <summary> /// Send a message to a particular recipient. /// </summary> public void SendMessage(NotificationMessagePanel message) { if (recipients.ContainsKey(message.RecipientName)) { NotificationRecipientPanel client = recipients[message.RecipientName]; client.EnqueueMessage(message); } }
/// <summary> /// This method is called by a sender to send a message to this client. /// </summary> /// <param name="message">the new message</param> public void EnqueueMessage(NotificationMessagePanel message) { lock (messageQueue) { messageQueue.Enqueue(message); // Set a new message event. messageEvent.Set(); } }