Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.S02_RequestTypesForAddressBookServerEndpoint.BuildModPropsRequestBody C# (CSharp) Method

BuildModPropsRequestBody() private method

Initialize ModProps request body.
private BuildModPropsRequestBody ( bool hasState, STAT stat, bool hasPropertyValues, PropertyTag propertyTag, bool hasPropertyTagsToRemove, LargePropertyTagArray propertyTagsToRemove ) : ModPropsRequestBody
hasState bool A Boolean value that specifies whether the State field is present.
stat STAT A STAT structure that specifies the state of a specific address book container.
hasPropertyValues bool A Boolean value that specifies whether the PropertyValues field is present.
propertyTag Microsoft.Protocols.TestSuites.Common.PropertyTag A property tag both identifies a property and gives the data type its value.
hasPropertyTagsToRemove bool A Boolean value that specifies whether the PropertyTagsToRemove field is present.
propertyTagsToRemove LargePropertyTagArray A LargePropTagArray structure that specifies the properties that the client is requesting to be removed.
return ModPropsRequestBody
        private ModPropsRequestBody BuildModPropsRequestBody(bool hasState, STAT stat, bool hasPropertyValues, PropertyTag propertyTag, bool hasPropertyTagsToRemove, LargePropertyTagArray propertyTagsToRemove)
        {
            ModPropsRequestBody modPropsRequestBody = new ModPropsRequestBody();
            modPropsRequestBody.Reserved = 0x0;
            byte[] auxIn = new byte[] { };
            modPropsRequestBody.AuxiliaryBuffer = auxIn;
            modPropsRequestBody.AuxiliaryBufferSize = (uint)auxIn.Length;

            modPropsRequestBody.HasState = hasState;
            if (hasState)
            {
                modPropsRequestBody.State = stat;
            }

            modPropsRequestBody.HasPropertyValues = hasPropertyValues;
            if (hasPropertyValues)
            {
                AddressBookPropertyValueList addressBookProperties = new AddressBookPropertyValueList();

                addressBookProperties.PropertyValueCount = 1;

                AddressBookTaggedPropertyValue[] taggedPropertyValues = new AddressBookTaggedPropertyValue[1];
                AddressBookTaggedPropertyValue taggedPropertyValue = new AddressBookTaggedPropertyValue();

                taggedPropertyValue.PropertyType = propertyTag.PropertyType;
                taggedPropertyValue.PropertyId = propertyTag.PropertyId;
                taggedPropertyValue.Value = new byte[] { 0x00, 0x00 };
                taggedPropertyValues[0] = taggedPropertyValue;
                addressBookProperties.PropertyValues = taggedPropertyValues;

                modPropsRequestBody.PropertyVaules = addressBookProperties;
            }

            modPropsRequestBody.HasPropertyTagsToRemove = hasPropertyTagsToRemove;
            if (hasPropertyTagsToRemove)
            {
                modPropsRequestBody.PropertyTagsToRemove = propertyTagsToRemove;
            }

            return modPropsRequestBody;
        }