using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TIBCO.Rendezvous;

namespace JWH.TIB
{

    public class ListenerSystem : ListenerInfo
    {

        public override void ReceivedMessage(object sender, MessageReceivedEventArgs eventArgs)
        {
            Message message = eventArgs.Message;

            //StringBuilder sb = new StringBuilder();
            //sb.AppendLine($"{message.ReplySubject} to {message.SendSubject}".Trim());
            //for (uint i = 0; i < message.FieldCount; i++)
            //{
            //    MessageField field = message.GetFieldByIndex(i);
            //    sb.AppendLine($"> {field.Name}={field.Value}");
            //}
            //Console.WriteLine( sb.ToString() );

            TibRendezvousEventArgs args = new TibRendezvousEventArgs(message);

            base.Raise_ReceivedEvent(args);
        }

    }

}
