Parse() public static method

Parse the QueryRows request type response body.
public static Parse ( byte rawData ) : QueryRowsResponseBody
rawData byte The raw data of response
return QueryRowsResponseBody
Esempio n. 1
0
        /// <summary>
        /// This method is used by the client to get a number of rows from the specified Explicit Table.
        /// </summary>
        /// <param name="queryRowsRequestBody">The QueryRows request type request body.</param>
        /// <returns>The response body of QueryRows request type</returns>
        public QueryRowsResponseBody QueryRows(QueryRowsRequestBody queryRowsRequestBody)
        {
            CommonResponse        commonResponse        = this.SendAddressBookRequest(queryRowsRequestBody, RequestType.QueryRows);
            QueryRowsResponseBody queryRowsResponseBody = QueryRowsResponseBody.Parse(commonResponse.ResponseBodyRawData);

            this.VerifyQueryRowsResponseBody(queryRowsResponseBody, queryRowsRequestBody);
            if (queryRowsResponseBody.HasColumnsAndRows)
            {
                foreach (AddressBookPropertyRow row in queryRowsResponseBody.RowData)
                {
                    this.VerifyAddressBookPropertyRowStructure(row);
                }

                this.VerifyLargePropTagArrayStructure(queryRowsResponseBody.Columns.Value);
            }

            return(queryRowsResponseBody);
        }
        /// <summary>
        /// This method is used by the client to get a number of rows from the specified Explicit Table.
        /// </summary>
        /// <param name="queryRowsRequestBody">The QueryRows request type request body.</param>
        /// <returns>The response body of QueryRows request type</returns>
        public QueryRowsResponseBody QueryRows(QueryRowsRequestBody queryRowsRequestBody)
        {
            CommonResponse        commonResponse        = this.SendAddressBookRequest(queryRowsRequestBody, RequestType.QueryRows);
            QueryRowsResponseBody queryRowsResponseBody = QueryRowsResponseBody.Parse(commonResponse.ResponseBodyRawData);

            this.VerifyQueryRowsResponseBody(queryRowsResponseBody, queryRowsRequestBody);
            if (queryRowsResponseBody.HasColumnsAndRows)
            {
                foreach (AddressBookPropertyRow row in queryRowsResponseBody.RowData)
                {
                    this.VerifyAddressBookPropertyRowStructure(row);

                    if (row.Flag == 0x0)
                    {
                        for (int i = 0; i < row.ValueArray.Length; i++)
                        {
                            if (queryRowsRequestBody.Columns.PropertyTags[i].PropertyType != 0x0000)
                            {
                                this.VerifyAddressBookPropertyValueStructure(row.ValueArray[i]);
                            }
                        }
                    }
                    else
                    {
                        for (int j = 0; j < row.ValueArray.Length; j++)
                        {
                            this.VerifyAddressBookFlaggedPropertyValueStructure((AddressBookFlaggedPropertyValue)row.ValueArray[j]);
                        }
                    }
                }

                this.VerifyLargePropertyTagArrayStructure(queryRowsResponseBody.Columns.Value);
            }

            return(queryRowsResponseBody);
        }