Ejemplo n.º 1
0
        private bool UpdateNamespaceByUriList(XmlNsInfo nsInfo)
        {
            bool flag = false;

            foreach (XmlNsInfo.XmlNsDefinition definition in nsInfo.NsDefs)
            {
                AssemblyNamespacePair pair = new AssemblyNamespacePair(nsInfo.Assembly, definition.ClrNamespace);
                this.GetXamlNamespace(definition.XmlNamespace).AddAssemblyNamespacePair(pair);
                flag = true;
            }
            return(flag);
        }
        internal static System.Type LookupClrNamespaceType(AssemblyNamespacePair nsPair, string typeName)
        {
            if ((nsPair.ClrNamespace == "System.Windows.Markup") && (nsPair.Assembly == typeof(XamlLanguage).Assembly))
            {
                switch (typeName)
                {
                case "Member":
                    return(typeof(MemberDefinition));

                case "Property":
                    return(typeof(PropertyDefinition));
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
        internal void AddAssemblyNamespacePair(AssemblyNamespacePair pair)
        {
            List <AssemblyNamespacePair> list;

            if (this._assemblyNamespaces == null)
            {
                list = new List <AssemblyNamespacePair>();
                this.Initialize();
            }
            else
            {
                list = new List <AssemblyNamespacePair>(this._assemblyNamespaces);
            }
            list.Add(pair);
            this._assemblyNamespaces = list;
        }
Ejemplo n.º 4
0
        // The XAML names of MemberDefinition and PropertyDefinition don't match their CLR type names.
        // LookupXamlType will still find them in the XAML namespace, but they won't be found through
        // clr-namespace lookup. This method handles that special case.
        internal static Type LookupClrNamespaceType(AssemblyNamespacePair nsPair, string typeName)
        {
            if (nsPair.ClrNamespace == SWMNamespace && nsPair.Assembly == typeof(XamlLanguage).Assembly)
            {
                switch (typeName)
                {
                case "Member":
                    return(typeof(MemberDefinition));

                case "Property":
                    return(typeof(PropertyDefinition));

                default:
                    return(null);
                }
            }
            return(null);
        }
Ejemplo n.º 5
0
        // This method should only be called inside SchemaContext._syncExaminingAssemblies lock
        internal void AddAssemblyNamespacePair(AssemblyNamespacePair pair)
        {
            // To allow the list to be read by multiple threads, we create a new list, add the pair,
            // then assign it back to the original variable.  Assignments are assured to be atomic.

            List <AssemblyNamespacePair> assemblyNamespacesCopy;

            if (_assemblyNamespaces == null)
            {
                assemblyNamespacesCopy = new List <AssemblyNamespacePair>();
                Initialize();
            }
            else
            {
                assemblyNamespacesCopy = new List <AssemblyNamespacePair>(_assemblyNamespaces);
            }

            assemblyNamespacesCopy.Add(pair);
            _assemblyNamespaces = assemblyNamespacesCopy;
        }