コード例 #1
0
        /// <summary>
        /// Is the given type a struct?
        /// </summary>
        public static bool IsStruct(this XTypeReference type)
        {
            XTypeDefinition typeDef;

            type = type.GetWithoutModifiers();
            return(type.IsStruct(out typeDef));
        }
コード例 #2
0
ファイル: GenericsConverter.cs プロジェクト: Xtremrules/dot42
        private static bool TreatAsStruct(XTypeReference type, XTypeReference resultType)
        {
            bool isStruct = resultType.IsStruct();
            bool isNullable = false;

            if (isStruct)
            {
                var gp = type as XGenericParameter;
                if (gp != null)
                {
                    var typeRef = gp.Owner as XTypeReference;
                    if (typeRef != null) isNullable = typeRef.IsSystemNullable();
                }
            }

            return isStruct && !isNullable;
        }
コード例 #3
0
        /// <summary>
        /// Is the given type a struct?
        /// </summary>
        public static bool IsStruct(this XTypeReference type)
        {
            XTypeDefinition typeDef;

            return(type.IsStruct(out typeDef));
        }