Microsoft.Protocols.TestSuites.MS_OXCROPS.S06_PropertyROPs.CreateMessageTaggedPropertyValueArray C# (CSharp) Method

CreateMessageTaggedPropertyValueArray() private method

Create an array of TaggedPropertyValue for message
private CreateMessageTaggedPropertyValueArray ( int &size ) : Microsoft.Protocols.TestSuites.Common.TaggedPropertyValue[]
size int The size of TaggedPropertyValue array
return Microsoft.Protocols.TestSuites.Common.TaggedPropertyValue[]
        private TaggedPropertyValue[] CreateMessageTaggedPropertyValueArray(out int size)
        {
            int arraySize = 0;
            TaggedPropertyValue[] result = new TaggedPropertyValue[2];

            // The following settings are from MS-OXOMSG 4.4.
            // PidTagBody
            result[0] = new TaggedPropertyValue
            {
                PropertyTag =
                {
                    PropertyId = this.propertyDictionary[PropertyNames.PidTagBody].PropertyId,
                    PropertyType = this.propertyDictionary[PropertyNames.PidTagBody].PropertyType
                },
                Value = Encoding.Unicode.GetBytes("Sign the order request.\0")
            };

            // PidTagMessageClass
            result[1] = new TaggedPropertyValue
            {
                PropertyTag =
                {
                    PropertyId = this.propertyDictionary[PropertyNames.PidTagMessageClass].PropertyId,
                    PropertyType = this.propertyDictionary[PropertyNames.PidTagMessageClass].PropertyType
                },
                Value = Encoding.ASCII.GetBytes("50\0")
            };

            for (int i = 0; i < result.Length; i++)
            {
                arraySize += result[i].Size();
            }

            size = arraySize;
            return result;
        }