Microsoft.Protocols.TestSuites.MS_OXORULE.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
            Microsoft.Protocols.TestSuites.Common.PropertyTag p = new PropertyTag();
            context.CurIndex += p.Deserialize(context.PropertyBytes, context.CurIndex);
            context.CurProperty.Type = (PropertyType)p.PropertyType;
            this.PropertyTag = p;
            base.Parse(context);
        }
    }

Usage Example

        /// <summary>
        /// Parse the AddressBookPropValueList structure.
        /// </summary>
        /// <param name="rawData">The raw data of response buffer.</param>
        /// <param name="index">The start index.</param>
        /// <returns>Instance of the AddressBookPropValueList.</returns>
        public static AddressBookPropValueList Parse(byte[] rawData, ref int index)
        {
            AddressBookPropValueList addressBookPropValueList = new AddressBookPropValueList();
            addressBookPropValueList.PropertyValueCount = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            Context.Instance.PropertyBytes = rawData;
            Context.Instance.CurIndex = index;
            Context.Instance.CurProperty = new Property(Microsoft.Protocols.TestSuites.Common.PropertyType.PtypUnspecified);

            addressBookPropValueList.PropertyValues = new AddressBookTaggedPropertyValue[addressBookPropValueList.PropertyValueCount];
            for (int i = 0; i < addressBookPropValueList.PropertyValueCount; i++)
            {
                // Parse the TaggedPropertyValue 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_OXORULE.AddressBookTaggedPropertyValue::Parse
AddressBookTaggedPropertyValue