public void RopGetPropertiesAllMethod(bool isPropertySizeLimitZero, bool isPropertyLagerThanLimit, bool isUnicode, out bool isValueContainsNotEnoughMemory)
{
#region Initialize parameters
// Set default value for isValueContainsNotEnoughMemory parameter.
isValueContainsNotEnoughMemory = false;
// Set value for wantUnidcode field.
ushort wantUnicode = 0;
if (isUnicode)
{
wantUnicode = 1;
}
// Set value for propertySizeLimit field.
ushort propertySizeLimit = 0;
// Set value for propertySizeLimit field.
if (!isPropertySizeLimitZero)
{
propertySizeLimit = PropertySizeLimit;
}
// Set value for tagPtyValues array.
TaggedPropertyValue[] tagPtyValues = new TaggedPropertyValue[1];
tagPtyValues[0] = this.GetTaggedPropertyTag(ObjectToOperate.FirstObject);
// Set value as the larger one than the limited value.
if (isPropertyLagerThanLimit)
{
List<byte> bytes = new List<byte>();
foreach (byte b in tagPtyValues[0].Value)
{
bytes.Add(b);
}
while (bytes.Count <= propertySizeLimit)
{
bytes.Add(ConstValues.PropertyBytesFilling);
}
bytes.Add(ConstValues.PropertyBytesFilling);
tagPtyValues[0].Value = bytes.ToArray();
}
if (tagPtyValues[0].PropertyTag.PropertyType == 0x0102)
{
tagPtyValues[0].Value = Common.AddInt16LengthBeforeBinaryArray(tagPtyValues[0].Value);
}
// Set Property before executing the query operation.
this.RopSetProperties(this.cprptCurrentHandle, tagPtyValues, true);
if (this.cprptCurrentType == ServerObjectType.Message)
{
this.RopSaveChangesMessage(this.cprptCurrentHandle, true);
}
else if (this.cprptCurrentType == ServerObjectType.Attachment)
{
this.RopSaveChangesAttachment(this.cprptCurrentHandle, true);
}
#endregion
RopGetPropertiesAllResponse getPropertiesAllResponse = this.RopGetPropertiesAll(this.cprptCurrentHandle, propertySizeLimit, wantUnicode);
if (this.cprptCurrentType == ServerObjectType.Message)
{
foreach (TaggedPropertyValue value in getPropertiesAllResponse.PropertyValues)
{
byte[] notEnoughMemory = BitConverter.GetBytes((uint)CPRPTErrorCode.NotEnoughMemory);
if (Common.CompareByteArray(notEnoughMemory, value.Value))
{
isValueContainsNotEnoughMemory = true;
}
}
}
if (this.cprptCurrentType == ServerObjectType.Attachment)
{
if (getPropertiesAllResponse.ReturnValue == (uint)CPRPTErrorCode.NotEnoughMemory)
{
isValueContainsNotEnoughMemory = true;
}
}
this.VerifyRopGetPropertiesAll(getPropertiesAllResponse, this.cprptCurrentType, isPropertySizeLimitZero, isPropertyLagerThanLimit, isUnicode, isValueContainsNotEnoughMemory);
}