public override bool Equals(Object obj)
{
if (obj == null)
return false;
RuntimeType thisType = (RuntimeType)this.GetType();
RuntimeType thatType = (RuntimeType)obj.GetType();
if (thatType != thisType)
return false;
Object thisObj = this;
Object thisResult, thatResult;
FieldInfo[] thisFields = thisType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
for (int i=0; i<thisFields.Length; i++)
{
thisResult = ((RuntimeFieldInfo)thisFields[i]).GetValue(thisObj);
thatResult = ((RuntimeFieldInfo)thisFields[i]).GetValue(obj);
if (thisResult == null)
{
if (thatResult != null)
return false;
}
else if (!thisResult.Equals(thatResult))
{
return false;
}
}
return true;
}