Example #1
0
        /// <summary>
        /// It builds a XML representation of an ISO 8583 message.
        /// </summary>
        /// <param name="renderingMap">
        /// It's the renderer map (see log4net).
        /// </param>
        /// <param name="component">
        /// It's the ISO 8583 message.
        /// </param>
        /// <param name="indent">
        /// It's the indentation to be used.
        /// </param>
        /// <returns>
        /// A XML representation of an ISO 8583 message.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// If the <paramref name="component"/> isn't an ISO 8583 message.
        /// </exception>
        public override string DoRender(RendererMap renderingMap,
                                        MessagingComponent component, string indent)
        {
            if (!(component is Iso8583Message))
            {
                throw new ArgumentException(SR.ComponentIsNotAnISO8583Message, "component");
            }

            Iso8583Message message = ( Iso8583Message)component;

            StringBuilder render = new StringBuilder();

            render.Append(indent);
            render.Append("<");
            render.Append(XmlIso8583MessageTag);
            render.Append(" ");
            render.Append(XmlIso8583MessageTypeIdentifierAttr);
            render.Append("=\"");
            render.Append(message.MessageTypeIdentifier.ToString(CultureInfo.InvariantCulture));
            render.Append("\">");
            render.Append(Environment.NewLine);

            render.Append((( Message)message).XmlRendering(renderingMap).DoRender(
                              renderingMap, message, indent + "   "));

            render.Append(indent);
            render.Append("</");
            render.Append(XmlIso8583MessageTag);
            render.Append(">");
            render.Append(Environment.NewLine);

            return(render.ToString());
        }
Example #2
0
        /// <summary>
        /// It clones the ISO 8583 message instance.
        /// </summary>
        /// <returns>
        /// A clone of the message instance.
        /// </returns>
        public override object Clone()
        {
            Iso8583Message clon = new Iso8583Message(_mti);

            CopyTo(clon);

            return(clon);
        }