Example #1
0
        public static bool TypesAreCompatible(OdbType type1, OdbType type2)
        {
            if (type1 == null || type2 == null)
            {
                return(false);
            }

            if (type1.IsArray() && type2.IsArray())
            {
                return(TypesAreCompatible(type1.SubType, type2.SubType));
            }

            if (type1.Name.Equals(type2.Name))
            {
                return(true);
            }

            if (type1.IsEnum() && type2.IsEnum())
            {
                return(type1.GetNativeClass() == type2.GetNativeClass());
            }

            if (type1.IsNative() && type2.IsNative())
            {
                return(type1.IsEquivalent(type2));
            }

            if (type1.IsNonNative() && type2.IsNonNative())
            {
                return((type1.GetNativeClass() == type2.GetNativeClass()) ||
                       (type1.GetNativeClass().IsAssignableFrom(type2.GetNativeClass())));
            }

            return(false);
        }
Example #2
0
        public static bool TypesAreCompatible(OdbType type1, OdbType type2)
        {
            if (type1 == null || type2 == null)
                return false;

            if (type1.IsArray() && type2.IsArray())
                return TypesAreCompatible(type1.SubType, type2.SubType);

            if (type1.Name.Equals(type2.Name))
                return true;

            if (type1.IsEnum() && type2.IsEnum())
                return type1.GetNativeClass() == type2.GetNativeClass();

            if (type1.IsNative() && type2.IsNative())
                return type1.IsEquivalent(type2);

            if (type1.IsNonNative() && type2.IsNonNative())
                return (type1.GetNativeClass() == type2.GetNativeClass()) ||
                       (type1.GetNativeClass().IsAssignableFrom(type2.GetNativeClass()));

            return false;
        }
Example #3
0
 internal bool IsNative()
 {
     return(_attributeType.IsNative());
 }