Exemplo n.º 1
0
        public static string AnalyzeNamespaceToDot(ProgramOption programOption)
        {
            using var assRes = GetAssemblyResolver(programOption.AssemblyPath);
            var ass          = assRes.Assembly;
            var types        = ass.GetTypes().Where(t => t.Namespace != null && t.Namespace.Contains(programOption.Namespace)).ToArray();
            var structureMap = new StructureMap();

            structureMap.AddTypes(types);
            return(structureMap.ToString(programOption.Namespace));
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Begin To Process");

                var programOption = new ProgramOption(args);
                var dotSource     = AnalyzeNamespaceToDot(programOption);
                Graphviz.RenderImageToFile(dotSource, programOption.OutputFormat, $"{programOption.Namespace}.{programOption.OutputFormat}");


                Console.WriteLine("Finish!");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            Console.ReadKey();
        }