Пример #1
0
        public static Header CreateHeader(string messageType, string session)
        {
            Header newHeader = new Header()
            {
                Username = Constants.USERNAME,
                Session = session,
                MessageId = Guid.NewGuid().ToString(),
                MessageType = messageType,
                Version = Constants.VERSION
            };

            return newHeader;
        }
Пример #2
0
        public static Message CreateMessage(string messageType, string content, Header parentHeader)
        {
            string session = parentHeader.Session;

            Message message = new Message()
            {
                UUID = session,
                ParentHeader = parentHeader,
                Header = MessageBuilder.CreateHeader(messageType, session),
                Content = content
            };

            return message;
        }