/// <summary> /// Parse fields from a FastTransferStream. /// </summary> /// <param name="stream">A FastTransferStream.</param> public override void Parse(FastTransferStream stream) { if (stream.ReadMarker() == Markers.StartEmbed) { this.StartMarker = Markers.NewAttach; this.MessageContent = new MessageContent(stream); if (stream.ReadMarker() == Markers.EndEmbed) { this.EndMarker = Markers.EndEmbed; } else { throw new Exception("The EmbeddedMessage cannot be parsed successfully. The EndEmbed Marker is missed."); } } }
/// <summary> /// Parse fields from a FastTransferStream. /// </summary> /// <param name="stream">A FastTransferStream.</param> public override void Parse(FastTransferStream stream) { Markers marker = stream.ReadMarker(); if (marker == Markers.StartMessage || marker == Markers.StartFAIMsg) { if (marker == Markers.StartMessage) { this.StartMarker1 = Markers.StartMessage; } else { this.StartMarker2 = Markers.StartFAIMsg; } this.Content = new MessageContent(stream); if (stream.ReadMarker() == Markers.EndMessage) { this.EndMarker = Markers.EndMessage; } else { throw new Exception("The Message cannot be parsed successfully. The EndMessage Marker is missed."); } } }