Пример #1
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)));
        }
Пример #2
0
 public static MemberAccessTypes GetAllowableMemberAccess(ITypeResolver typeResolver, IType typeId)
 {
     return(typeResolver.InTargetAssembly(typeId) ? MemberAccessTypes.PublicOrInternal : MemberAccessTypes.Public);
 }