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

Parse() public method

Parse bytes in context into TaggedPropertyValueNode
public Parse ( Context context ) : void
context Context The value of Context
return void
        public override void Parse(Context context)
        {
            // Parse PropertyType and assign it to context's current PropertyType
            this.PropertyType = (ushort)BitConverter.ToInt16(context.PropertyBytes, context.CurIndex);
            context.CurProperty.Type = (PropertyType)this.PropertyType;
            context.CurIndex += sizeof(ushort);
            this.PropertyId = (ushort)BitConverter.ToInt16(context.PropertyBytes, context.CurIndex);
            context.CurIndex += sizeof(ushort);
            base.Parse(context);           
        }
    }

Usage Example

        /// <summary>
        /// Parse the AddressBookPropertyValueList structure.
        /// </summary>
        /// <param name="rawData">The raw data of response buffer.</param>
        /// <param name="index">The start index.</param>
        /// <returns>Instance of the AddressBookPropertyValueList.</returns>
        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;
        }
All Usage Examples Of Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.AddressBookTaggedPropertyValue::Parse
AddressBookTaggedPropertyValue