예제 #1
0
        public static void init( )
        {
            // if ( allNamespaces != null ) return;
            allNamespaces = new NamespaceList();

            nsCached = new Dictionary <string, TypeNodeList>();

            // Scan all assemblies referenced in parameters
            // and take all namespaces from them.
            // Put all these namespaces into the common list.
            System.Collections.Specialized.StringCollection assemblies = CONTEXT.options.ReferencedAssemblies;
            foreach (string assName in assemblies)
            {
                AssemblyNode assembly = AssemblyNode.GetAssembly(assName, true, false, true);
                if (assembly == null && !CONTEXT.AnalysisOnly)
                {
                    ERROR.UnresolvedReference(assName);
                    continue;
                }
                NamespaceList nss = assembly.GetNamespaceList();
                for (int i = 0, n = nss.Length; i < n; i++)
                {
                    allNamespaces.Add(nss[i]);
                }
            }
        }