public static bool AreTwoAddressBookPropertyRowEqual(AddressBookPropertyRow[] propertyRows1, AddressBookPropertyRow[] propertyRows2)
{
if (propertyRows1.Length != propertyRows2.Length)
{
site.Log.Add(
LogEntryKind.Debug,
"The length of propertyRows1 is {0}, the length of propertyRows2 is {1}.",
propertyRows1.Length,
propertyRows2.Length);
return false;
}
else
{
for (int i = 0; i < propertyRows1.Length; i++)
{
AddressBookPropertyRow propertyRow1 = propertyRows1[i];
AddressBookPropertyRow propertyRow2 = propertyRows2[i];
if (propertyRow1.Flag != propertyRow2.Flag)
{
site.Log.Add(
LogEntryKind.Debug,
"The value of Flag field of propertyRow1 is {0}, the value of Flag field of propertyRow2 is {1}.",
propertyRow1.Flag,
propertyRow2.Flag);
return false;
}
else
{
List<AddressBookPropertyValue> valueArray1 = new List<AddressBookPropertyValue>();
valueArray1.AddRange(propertyRow1.ValueArray);
List<AddressBookPropertyValue> valueArray2 = new List<AddressBookPropertyValue>();
valueArray2.AddRange(propertyRow2.ValueArray);
if (valueArray1.Count != valueArray2.Count)
{
site.Log.Add(
LogEntryKind.Debug,
"The length of valueArray1 is {0}, the length of valueArray2 is {1}.",
valueArray1.Count,
valueArray2.Count);
return false;
}
else
{
for (int j = 0; j < valueArray1.Count; j++)
{
if (valueArray1[j].Value.Length != valueArray2[j].Value.Length)
{
site.Log.Add(
LogEntryKind.Debug,
"The length of the first property value is {0}, the length of the second property value is {1}.",
valueArray1[j].Value.Length,
valueArray2[j].Value.Length);
return false;
}
else
{
byte[] valueOfProperty1 = valueArray1[j].Value;
byte[] valueOfProperty2 = valueArray2[j].Value;
for (int k = 0; k < valueOfProperty1.Length; k++)
{
if (valueOfProperty1[k] != valueOfProperty2[k])
{
site.Log.Add(
LogEntryKind.Debug,
"The {0} bit of the first property value is {1}, The {0} bit of the second property value is {2}.",
valueOfProperty1[k],
valueOfProperty2[k]);
return false;
}
}
}
}
}
}
}
}
return true;
}