Exemplo n.º 1
0
        /// <summary>
        /// Parses one list element.
        /// </summary>
        /// <param name="Reader">The packet data reader.</param>
        /// <param name="List">Current list.</param>
        /// <param name="index">Index of the current element.</param>
        /// <param name="parser">The Xml packet parser.</param>
        /// <returns>The parsed string.</returns>
        public string ParseList(ulong index, XmlParser parser, StreamHandler Reader, ListPacketSegment List)
        {
            //   1) Member1: 3
            //      Member2: 4

            string content = index.ToString().PadLeft(3) + ") ";

            bool first = true;

            foreach (XmlPacketSegment segment in List.GetContainedSegments())
            {
                if (!first)
                {
                    content += string.Empty.PadRight(5);
                }
                else
                {
                    first = false;
                }

                content += segment.Parse(parser, Reader, List).PadMultiline(5) + Environment.NewLine;
            }

            return(content);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Parses one list element.
        /// </summary>
        /// <param name="Reader">The packet data reader.</param>
        /// <param name="List">Current list.</param>
        /// <param name="index">Index of the current element.</param>
        /// <param name="parser">The Xml packet parser.</param>
        /// <returns>The parsed string.</returns>
        public string ParseList(ulong index, XmlParser parser, StreamHandler Reader, ListPacketSegment List)
        {
            //   1) Member1: 3
            //      Member2: 4

            string content = index.ToString().PadLeft(3) + ") ";

            bool first = true;
            foreach (XmlPacketSegment segment in List.GetContainedSegments())
            {
                if (!first)
                    content += string.Empty.PadRight(5);
                else
                    first = false;

                content += segment.Parse(parser, Reader, List).PadMultiline(5) + Environment.NewLine;
            }

            return content;
        }