public void AddMessage(MessageRecord r)
 {
     try
     {
         Messages.Add(r);
     }
     catch (Exception e)
     {
         Trace.WriteLine(e.ToString());
     }
 }
        public void HandleMessage(QuickFix.Message msg, bool isIncoming)
        {
            try
            {
                MessageRecord mr = new MessageRecord(msg, isIncoming);

                SmartDispatcher.Invoke(new Action<MessageRecord>(AddMessage), mr);
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }