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;
}