Ejemplo n.º 1
0
        public Dictionary <string, TypeDef[]> GetTypes(string[] assemblyPaths, ClassTypeFilter filter)
        {
            Dictionary <string, TypeDef[]> dictionary = new Dictionary <string, TypeDef[]>();

            TypeDef[]      types;
            List <TypeDef> typesList;

            foreach (string path in assemblyPaths)
            {
                AssemblyDef assembly = AssemblyDef.LoadFrom(path);
                types     = assembly.GetTypes();
                typesList = new List <TypeDef>();
                foreach (TypeDef t in types)
                {
                    if (filter != null)
                    {
                        if (filter.FilterType(t))
                        {
                            typesList.Add(t);
                        }
                    }
                    else
                    {
                        typesList.Add(t);
                    }
                }
                dictionary.Add(path, typesList.ToArray());
            }
            return(dictionary);
        }
Ejemplo n.º 2
0
        public string[] GetClassTypeNames(string assemblyPath, ClassTypeFilter filter)
        {
            List <string> typeNames = new List <string>();
            AssemblyDef   assembly  = AssemblyDef.LoadFrom(assemblyPath);

            foreach (TypeDef type in assembly.GetTypes())
            {
                if (filter != null)
                {
                    if (filter.FilterType(type))
                    {
                        typeNames.Add(type.FullName);
                    }
                }
                else
                {
                    typeNames.Add(type.FullName);
                }
            }
            return(typeNames.ToArray());
        }
Ejemplo n.º 3
0
        public TypeDef[] GetTypes(string assemblyPath, ClassTypeFilter filter)
        {
            AssemblyDef assembly = AssemblyDef.LoadFrom(assemblyPath);

            TypeDef[]      types     = assembly.GetTypes();
            List <TypeDef> typesList = new List <TypeDef>();

            foreach (TypeDef t in types)
            {
                if (filter != null)
                {
                    if (filter.FilterType(t))
                    {
                        typesList.Add(t);
                    }
                }
                else
                {
                    typesList.Add(t);
                }
            }
            return(typesList.ToArray());
        }