public override bool Equals(object other)
{
if (other == null)
{
return false;
}
if (other.Equals(NullValue.Instance()))
{
for (int i = 0; i < length; i++)
{
if (!Get(i).Equals(NullValue.Instance()))
{
return false;
}
}
return true;
}
if (ReferenceEquals(this, other))
{
return true;
}
if (!(other is CongenericChain))
{
return false;
}
var chainObject = (CongenericChain)other;
if (!element.Equals(chainObject.Element))
{
return false;
}
for (int i = 0; (i < chainObject.length) && (i < length); i++)
{
if (!this[i].Equals(chainObject[i]))
{
return false;
}
}
return true;
}