Microsoft.Protocols.TestSuites.MS_OXNSPI.NspiMapiHttpAdapter.ModLinkAtt C# (CSharp) Method

ModLinkAtt() public method

The NspiModLinkAtt method modifies the values of a specific property of a specific row in the address book.
public ModLinkAtt ( uint flags, uint propTag, uint mid, BinaryArray_r entryIds ) : ErrorCodeValue
flags uint A DWORD value that contains a set of bit flags.
propTag uint A DWORD value. It contains the proptag of the property that the client wants to modify.
mid uint A DWORD value that contains the Minimal Entry ID of the address book row that the client wants to modify.
entryIds BinaryArray_r A BinaryArray value. It contains a list of EntryIDs to be used to modify the requested property on the requested address book row.
return ErrorCodeValue
        public ErrorCodeValue ModLinkAtt(uint flags, uint propTag, uint mid, BinaryArray_r entryIds)
        {
            ErrorCodeValue result;
            ModLinkAttRequestBody modLinkAttRequestBody = new ModLinkAttRequestBody();
            modLinkAttRequestBody.Flags = flags;
            modLinkAttRequestBody.PropertyTag = new PropertyTag()
            {
                PropertyId = (ushort)((propTag & 0xFFFF0000) >> 16),
                PropertyType = (ushort)(propTag & 0x0000FFFF)
            };
            modLinkAttRequestBody.MinimalId = mid;
            if (entryIds.CValues != 0)
            {
                modLinkAttRequestBody.HasEntryIds = true;
                modLinkAttRequestBody.EntryIdCount = entryIds.CValues;
                modLinkAttRequestBody.EntryIDs = new byte[entryIds.CValues][];
                for (int i = 0; i < entryIds.CValues; i++)
                {
                    List<byte> entryIDBytes = new List<byte>();
                    entryIDBytes.AddRange(BitConverter.GetBytes((uint)entryIds.Lpbin[i].Lpb.Length));
                    entryIDBytes.AddRange(entryIds.Lpbin[i].Lpb);
                    modLinkAttRequestBody.EntryIDs[i] = entryIDBytes.ToArray();
                }
            }
            else
            {
                modLinkAttRequestBody.HasEntryIds = false;
            }

            byte[] auxIn = new byte[] { };
            modLinkAttRequestBody.AuxiliaryBuffer = auxIn;
            modLinkAttRequestBody.AuxiliaryBufferSize = (uint)auxIn.Length;

            ChunkedResponse chunkedResponse = this.SendAddressBookRequest(modLinkAttRequestBody, RequestType.ModLinkAtt);
            ModLinkAttResponseBody modLinkAttResponseBody = ModLinkAttResponseBody.Parse(chunkedResponse.ResponseBodyRawData);
            result = (ErrorCodeValue)modLinkAttResponseBody.ErrorCode;
            return result;
        }