Пример #1
0
        private static Graph Generate(Options options)
        {
            IEnumerable <string> patterns;
            IEnumerable <string> searchPaths;

            AssemblySearchHelper.OptionsToNamesAndSearchPath(options, out patterns, out searchPaths);
            var assemblyFullNames = AssemblySearchHelper.GetAssemblyFullNames(patterns, searchPaths);

            Console.WriteLine("{0} files found.", assemblyFullNames.Count);
            if (assemblyFullNames.Count == 0)
            {
                Environment.Exit(1);
            }
            Console.WriteLine("Loading assemblies:");
            var rootName = GenerateResultFileName(assemblyFullNames);

            var ePrev    = AnalyzesProgress.Started();
            var analyzer = new Analyzer(eCurrent => { ePrev = ConsoleProgress(eCurrent, ePrev); });

            using (var loadHelper = new AssemblyLoadHelper(searchPaths))
            {
                var assemblies = assemblyFullNames.Select(loadHelper.Load);
                analyzer.Analyze(assemblies, rootName);
            }
            return(analyzer.GetGraph());
        }