private static bool EqualFields(RawSerializer.OwnerFieldPair left, RawSerializer.OwnerFieldPair right)
 {
     if (left.field != null && right.field != null)
     {
         if (!object.Equals(left.field, right.field))
         {
             return(false);
         }
     }
     else
     {
         Type        type    = left.owner.GetType();
         Type        type2   = right.owner.GetType();
         FieldInfo[] fields  = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
         FieldInfo[] fields2 = type2.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
         for (int i = 0; i < fields.Length; i++)
         {
             FieldInfo fieldInfo  = fields[i];
             FieldInfo fieldInfo2 = fields2[i];
             if (fieldInfo == null || fieldInfo2 == null)
             {
                 return(false);
             }
             if (!RawSerializer.IsIngoreField(fieldInfo))
             {
                 if (fieldInfo.FieldType.IsArray)
                 {
                     Array array  = fieldInfo.GetValue(left.owner) as Array;
                     Array array2 = fieldInfo2.GetValue(right.owner) as Array;
                     int   num    = Math.Min(array.Length, array2.Length);
                     for (int j = 0; j < num; j++)
                     {
                         RawSerializer.OwnerFieldPair left2  = new RawSerializer.OwnerFieldPair(left.owner, array.GetValue(j));
                         RawSerializer.OwnerFieldPair right2 = new RawSerializer.OwnerFieldPair(right.owner, array2.GetValue(j));
                         if (!RawSerializer.EqualFields(left2, right2))
                         {
                             return(false);
                         }
                     }
                 }
                 else
                 {
                     object value  = fieldInfo.GetValue(left.owner);
                     object value2 = fieldInfo2.GetValue(right.owner);
                     RawSerializer.OwnerFieldPair left3;
                     RawSerializer.OwnerFieldPair right3;
                     if (type.IsPrimitive || type == typeof(string))
                     {
                         left3  = new RawSerializer.OwnerFieldPair(left.owner, value);
                         right3 = new RawSerializer.OwnerFieldPair(right.owner, value2);
                     }
                     else
                     {
                         left3  = new RawSerializer.OwnerFieldPair(value, null);
                         right3 = new RawSerializer.OwnerFieldPair(value2, null);
                     }
                     if (!RawSerializer.EqualFields(left3, right3))
                     {
                         return(false);
                     }
                 }
             }
         }
     }
     return(true);
 }
 public new static bool Equals(object left, object right)
 {
     return(left.GetType() == right.GetType() && RawSerializer.EqualFields(new RawSerializer.OwnerFieldPair(left, null), new RawSerializer.OwnerFieldPair(right, null)));
 }