Parse() public method

Parse bytes in context into a PropertyRowNode
public Parse ( Context context ) : void
context Context The value of Context
return void
Example #1
0
        /// <summary>
        /// Parse bytes in context into a PropertyRowSetNode
        /// </summary>
        /// <param name="context">The value of Context</param>
        public override void Parse(Context context)
        {
            // No PropertyRowNode to parse
            if (this.count <= 0)
            {
                return;
            }

            // Clear PropretyRows list to store parsing result
            context.PropertyRows.Clear();

            // Parse PropertyRow one by one
            for (int i = 0; i < this.count; i++)
            {
                if (context.IsEnd())
                {
                    throw new ParseException("End prematurely");
                }

                PropertyRow propertyRow = new PropertyRow();
                propertyRow.Parse(context);
                context.PropertyRows.Add(propertyRow);
            }

            // Assign parsing result to PropertyRows
            this.propertyRows = context.PropertyRows;
        }
        /// <summary>
        /// Parse bytes in context into a PropertyRowSetNode
        /// </summary>
        /// <param name="context">The value of Context</param>
        public override void Parse(Context context)
        {
            // No PropertyRowNode to parse
            if (this.count <= 0)
            {
                return;
            }

            // Clear PropretyRows list to store parsing result
            context.PropertyRows.Clear();

            // Parse PropertyRow one by one
            for (int i = 0; i < this.count; i++)
            {
                if (context.IsEnd())
                {
                    throw new ParseException("End prematurely");
                }

                PropertyRow propertyRow = new PropertyRow();
                propertyRow.Parse(context);
                context.PropertyRows.Add(propertyRow);
            }

            // Assign parsing result to PropertyRows
            this.propertyRows = context.PropertyRows;
        }