Esempio n. 1
0
        private static bool IsEqual(object a_compare, object a_with, string a_path, ArrayList
                                    a_list)
        {
            if (a_compare == null)
            {
                return(a_with == null);
            }
            if (a_with == null)
            {
                return(false);
            }
            Type clazz = a_compare.GetType();

            if (clazz != a_with.GetType())
            {
                return(false);
            }
            if (Platform4.IsSimple(clazz))
            {
                return(a_compare.Equals(a_with));
            }
            // takes care of repeating calls to the same object
            if (a_list.Contains(a_compare))
            {
                return(true);
            }
            a_list.Add(a_compare);
            if (a_compare.GetType().IsArray)
            {
                return(AreArraysEqual(NormalizeNArray(a_compare), NormalizeNArray(a_with), a_path
                                      , a_list));
            }
            if (HasPublicConstructor(a_compare.GetType()))
            {
                return(AreFieldsEqual(a_compare, a_with, a_path, a_list));
            }
            return(a_compare.Equals(a_with));
        }
Esempio n. 2
0
        private bool HasValueTypeBehavior(object obj)
        {
            bool isSimple = Platform4.IsSimple(obj.GetType());

            if (isSimple)
            {
                return(true);
            }
            IReflectClass reflectClass = _container.Reflector().ForObject(obj);

            if (Platform4.IsStruct(reflectClass))
            {
                return(true);
            }
            bool isEnum = Platform4.IsEnum(_container.Reflector(), reflectClass);

            if (isEnum)
            {
                return(true);
            }
            ITypeHandler4 typeHandler = _container.TypeHandlerForClass(reflectClass);

            return(Handlers4.IsValueType(typeHandler));
        }
Esempio n. 3
0
 public bool IsSimple()
 {
     return(IsPrimitive() || Platform4.IsSimple(_type));
 }
Esempio n. 4
0
 public virtual bool IsImmutable()
 {
     return(IsPrimitive() || Platform4.IsSimple(_class));
 }