public override int GetHashCode()
{
// One of the ideas from http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode
const int b = 378551;
int a = 63689;
int hash = 0;
unchecked
{
for (int i = 0; i < rectangles.Count; i++)
{
if (rectangles[i] != null)
{
hash = hash * a + rectangles[i].GetHashCode();
a = a * b;
}
}
hash *= 397;
}
return hash ^ sheetId.GetHashCode();
}