Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.AddressBookPropertyValueList.Parse C# (CSharp) Method

Parse() public static method

Parse the AddressBookPropertyValueList structure.
public static Parse ( byte rawData, int &index ) : AddressBookPropertyValueList
rawData byte The raw data of response buffer.
index int The start index.
return AddressBookPropertyValueList
        public static AddressBookPropertyValueList Parse(byte[] rawData, ref int index)
        {
            AddressBookPropertyValueList addressBookPropValueList = new AddressBookPropertyValueList();
            addressBookPropValueList.PropertyValueCount = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            Context.Instance.PropertyBytes = rawData;
            Context.Instance.CurIndex = index;
            Context.Instance.CurProperty = new Property(PropertyType.PtypUnspecified);

            addressBookPropValueList.PropertyValues = new AddressBookTaggedPropertyValue[addressBookPropValueList.PropertyValueCount];
            for (int i = 0; i < addressBookPropValueList.PropertyValueCount; i++)
            {
                // Parse the AddressBookTaggedPropertyValue from the response buffer.
                AddressBookTaggedPropertyValue taggedPropertyValue = new AddressBookTaggedPropertyValue();
                taggedPropertyValue.Parse(Context.Instance);
                addressBookPropValueList.PropertyValues[i] = taggedPropertyValue;
            }

            index = Context.Instance.CurIndex;

            return addressBookPropValueList;
        }
    }

Usage Example

Example #1
0
        /// <summary>
        /// Parse the GetProps request type response body.
        /// </summary>
        /// <param name="rawData">The raw data of response.</param>
        /// <returns>The GetProps request type response body.</returns>
        public static GetPropsResponseBody Parse(byte[] rawData)
        {
            GetPropsResponseBody responseBody = new GetPropsResponseBody();
            int index = 0;

            responseBody.StatusCode = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.CodePage = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.HasPropertyValues = BitConverter.ToBoolean(rawData, index);
            index += sizeof(bool);
            if (responseBody.HasPropertyValues)
            {
                responseBody.PropertyValues = AddressBookPropertyValueList.Parse(rawData, ref index);
            }
            else
            {
                responseBody.PropertyValues = null;
            }

            responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index);
            index += 4;
            responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize];
            Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize);
            return(responseBody);
        }
All Usage Examples Of Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.AddressBookPropertyValueList::Parse
AddressBookPropertyValueList