using MES.Utility.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Weiz.EventBus.Core;

namespace MES.Utility.EventBus
{
    public class SendMessageEvent : IEvent
    {
        public SendMessageEvent() { }
        public SendMessageEvent(byte[] data)
        {
            Data = data;
        }

        public byte[] Data { get; set; }

        public string DataHexString
        {
            get
            {
                if (Data == null)
                    return string.Empty;
                return Data.Select(it => Convert.ToString(it, 16).PadLeft(2, '0').ToUpper()).ToList().GetStrArray(" ");
            }
        }
    }
}
