Example #1
0
        public static async Task <StadRegistry> MakeRegistry(IAssemblySource assemblySource)
        {
            if (assemblySource.IsAvailable == false)
            {
                throw new Exception($"AssemblySource not initialized : {assemblySource}");
            }

            List <Assembly> assemblies = new List <Assembly>();

            string[] assemblyNames = await assemblySource.GetAssemblyTargetFiles();

            foreach (string path in assemblyNames)
            {
                Assembly assembly = Assembly.LoadFrom(path);
                assemblies.Add(assembly);
            }

            TypeCollectorForAssembly typeCollectorForAssembly = new TypeCollectorForAssembly(assemblies.ToArray(), (str) => Console.WriteLine(str));
            var result = typeCollectorForAssembly.Collect();

            return(MakeRegistry(result));
        }