Example #1
0
        public static void EnqueueMessage(MessageEntry message)
        {
            if (!_messageQueue.IsAddingCompleted)
            {
                try
                {
                    _messageQueue.Add(message);
                    return;
                }
                catch (InvalidOperationException) { }
            }

            // Adding is completed so just log the message
            //try
            //{
            //    WriteMessage(message);
            //}
            //catch (Exception) { }
        }
Example #2
0
 // for testing
 private static void WriteMessage(MessageEntry message)
 {
     //do something
     Console.WriteLine(message.title);
 }