示例#1
0
        internal XamlType GetXamlType(XamlTypeName typeName, bool returnUnknownTypesOnFailure,
                                      bool skipVisibilityCheck)
        {
            Debug.Assert(typeName != null, "typeName cannot be null and should have been checked before now");
            Debug.Assert(typeName.Name != null, "typeName.Name cannot be null and should have been checked before now");
            Debug.Assert(typeName.Namespace != null);
            XamlType xamlType = _schemaContext.GetXamlType(typeName);

            if (xamlType != null && !skipVisibilityCheck && !xamlType.IsVisibleTo(LocalAssembly))
            {
                xamlType = null;
            }

            if (xamlType == null && returnUnknownTypesOnFailure)
            {
                XamlType[] typeArgs = null;
                if (typeName.HasTypeArgs)
                {
                    typeArgs = ArrayHelper.ConvertArrayType <XamlTypeName, XamlType>(
                        typeName.TypeArguments, GetXamlTypeOrUnknown);
                }
                xamlType = new XamlType(typeName.Namespace, typeName.Name, typeArgs, SchemaContext);
            }
            return(xamlType);
        }
示例#2
0
        internal XamlType GetXamlType(XamlTypeName typeName, bool returnUnknownTypesOnFailure,
                                      bool skipVisibilityCheck)
        {
            Debug.Assert(typeName != null, "typeName cannot be null and should have been checked before now");
            Debug.Assert(typeName.Name != null, "typeName.Name cannot be null and should have been checked before now");
            Debug.Assert(typeName.Namespace != null);
            XamlType xamlType = _schemaContext.GetXamlType(typeName);

            if (xamlType != null && !skipVisibilityCheck && !xamlType.IsVisibleTo(LocalAssembly))
            {
                xamlType = null;
            }

            if (xamlType == null && returnUnknownTypesOnFailure)
            {
                XamlType[] typeArgs = null;
                if (typeName.HasTypeArgs)
                {
                    List <XamlTypeName> typeNames = typeName.TypeArgumentsList;
                    typeArgs = new XamlType[typeNames.Count];
                    for (int i = 0; i < typeArgs.Length; i++)
                    {
                        typeArgs[i] = GetXamlTypeOrUnknown(typeNames[i]);
                    }
                }
                xamlType = new XamlType(typeName.Namespace, typeName.Name, typeArgs, SchemaContext);
            }
            return(xamlType);
        }
        private XamlType GetXamlType(string ns, string name, IList <XamlType> typeArguments)
        {
            XamlType[] array = new XamlType[typeArguments.Count];
            typeArguments.CopyTo(array, 0);
            XamlType type = this._schemaContext.GetXamlType(ns, name, array);

            if ((type != null) && !type.IsVisibleTo(this.LocalAssembly))
            {
                type = null;
            }
            return(type);
        }
示例#4
0
        private XamlType GetXamlType(string ns, string name, IList <XamlType> typeArguments)
        {
            XamlType[] typeArgArray = new XamlType[typeArguments.Count];
            typeArguments.CopyTo(typeArgArray, 0);
            XamlType xamlType = _schemaContext.GetXamlType(ns, name, typeArgArray);

            if (xamlType != null && !xamlType.IsVisibleTo(LocalAssembly))
            {
                xamlType = null;
            }
            return(xamlType);
        }
        internal XamlType GetXamlType(XamlTypeName typeName, bool returnUnknownTypesOnFailure, bool skipVisibilityCheck)
        {
            XamlType xamlType = this._schemaContext.GetXamlType(typeName);

            if (((xamlType != null) && !skipVisibilityCheck) && !xamlType.IsVisibleTo(this.LocalAssembly))
            {
                xamlType = null;
            }
            if ((xamlType != null) || !returnUnknownTypesOnFailure)
            {
                return(xamlType);
            }
            XamlType[] typeArguments = null;
            if (typeName.HasTypeArgs)
            {
                typeArguments = ArrayHelper.ConvertArrayType <XamlTypeName, XamlType>(typeName.TypeArguments, new Func <XamlTypeName, XamlType>(this.GetXamlTypeOrUnknown));
            }
            return(new XamlType(typeName.Namespace, typeName.Name, typeArguments, this.SchemaContext));
        }