Beispiel #1
0
        static SLImportModules ImportsForPlatform(PlatformName platform, TypeDefinition [] types)
        {
            var imports     = new SLImportModules();
            var modulesUsed = new HashSet <string> ();

            foreach (var type in types)
            {
                var moduleName = type.Namespace;
                var name       = "ThisShouldNeverGetFiltered";
                if (TypeAggregator.FilterModuleAndName(platform, type.Namespace, ref name))
                {
                    TypeAggregator.RemapModuleAndName(platform, ref moduleName, ref name, TypeType.None);
                    if (String.IsNullOrEmpty(moduleName))
                    {
                        continue;
                    }
                    if (modulesUsed.Contains(moduleName))
                    {
                        continue;
                    }
                    modulesUsed.Add(moduleName);
                    imports.Add(new SLImport(moduleName));
                }
            }
            return(imports);
        }