コード例 #1
0
        public static bool IsAccessibleType(ITypeResolver typeResolver, Type type)
        {
            IType type1 = typeResolver.GetType(type);

            if (type1 != null)
            {
                return(TypeHelper.IsAccessibleType(typeResolver, type1));
            }
            return(false);
        }
コード例 #2
0
        public static bool CanCreateTypeInXaml(ITypeResolver typeResolver, Type type)
        {
            IType type1 = typeResolver.GetType(type);

            if (typeResolver.PlatformMetadata.IsNullType(type1) || !TypeHelper.IsAccessibleType(typeResolver, type1) || Nullable.GetUnderlyingType(type) != null)
            {
                return(false);
            }
            if (type == typeof(string) || TypeUtilities.HasDefaultConstructor(type, typeResolver.InTargetAssembly(type1)))
            {
                return(true);
            }
            return(type1.TypeConverter.CanConvertFrom(typeof(string)));
        }