GetEnumerationType() static private method

static private GetEnumerationType ( Type type ) : Type
type System.Type
return System.Type
Example #1
0
        public bool CanCompare(Type type1, Type type2)
        {
            var isSetType1 = ReflectionCache.IsSetType(type1);
            var isSetType2 = ReflectionCache.IsSetType(type2);

            if (!isSetType1 && !isSetType2)
            {
                return(false);
            }

            if (!isSetType1 && !ReflectionCache.IsListType(type1))
            {
                return(false);
            }

            if (!isSetType2 && !ReflectionCache.IsListType(type2))
            {
                return(false);
            }

            var elementType1 = ReflectionCache.GetEnumerationType(type1);
            var elementType2 = ReflectionCache.GetEnumerationType(type2);

            return(Inner.CanCompare(elementType1, elementType2));
        }
Example #2
0
        private bool CheckInnerCanCompare(Type listType1, Type listType2)
        {
            var type1 = ReflectionCache.GetEnumerationType(listType1);
            var type2 = ReflectionCache.GetEnumerationType(listType2);

            return(Inner.CanCompare(type1, type2));
        }
Example #3
0
        public bool CanCompare(Type type1, Type type2)
        {
            if (!ReflectionCache.IsListType(type1) || !ReflectionCache.IsListType(type2))
            {
                return(false);
            }

            return(checkInnerCanCompare());

            bool checkInnerCanCompare()
            {
                var innerType1 = ReflectionCache.GetEnumerationType(type1);
                var innerType2 = ReflectionCache.GetEnumerationType(type2);

                return(Inner.CanCompare(innerType1, innerType2));
            }
        }