예제 #1
0
        private bool TryParse(byte[] buffer, ref int pos)
        {
            IMarker marker;
            if (Marker.TryCreateMarker(buffer, ref pos, out marker) && Marker.IsSpecificMarker(marker, Marker.StartEmbed))
            {
                StartEmbed = marker;
            }
            else
                return false;

            MsgContent = MessageContent.CreateMessageContent(buffer, ref pos);

            if (Marker.TryCreateMarker(buffer, ref pos, out marker) && Marker.IsSpecificMarker(marker, Marker.EndEmbed))
            {
                EndEmbed = marker;
            }
            else
                throw new ArgumentException("Embeddedmessage end parse error.");

            return true;
        }
예제 #2
0
 internal static MessageContent CreateMessageContent(byte[] buffer, ref int pos)
 {
     MessageContent msgContent = new MessageContent();
     msgContent.ParseMessageContent(buffer, ref pos);
     return msgContent;
 }