예제 #1
0
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Expect:");
                Console.WriteLine("1. directory path to generated XML Documentation files");
                Console.WriteLine("2. full path to .md file to update");
                return;
            }

            string strFullAssemblyDocDir = args[0];        // full path to assembly documentation file ( xml)
            string strFullDocName        = args[1];        // full path to .md that will be created


            var nodes = NodeParser.GetNodesFromAssemblies(new string[] { "AdvanceSteelNodes.dll", "AdvanceSteelNodesUI.dll" });

            MDGenerator.GenerateFromAssembly(strFullAssemblyDocDir, nodes, strFullDocName);
        }
예제 #2
0
        public static void GenerateFromAssembly(string strFullAssemblyDocDir, IEnumerable <Member> methods, string strFullDocName)
        {
            // try to read the doc content
            //
            List <string> xmlFiles  = getAllXmlFiles(strFullAssemblyDocDir);
            Doc           docForAll = new Doc();

            foreach (string strXmlFile in xmlFiles)
            {
                try
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(Doc));
                    using (FileStream fileStream = new FileStream(strXmlFile, FileMode.Open))
                    {
                        Doc currDoc = (Doc)serializer.Deserialize(fileStream);
                        if (null == currDoc)
                        {
                            System.Console.WriteLine(" Cannot read the XML file !" + strXmlFile + " ... continue...");
                            continue;
                        }

                        docForAll.AddContent(currDoc);
                    }
                }
                catch { }
            }


            // .. try to generate the MD file at the specific location
            //
            bool bOk = MDGenerator.Generate(docForAll, methods, strFullDocName);

            if (!bOk)
            {
                System.Console.WriteLine(" Cannot not find all methods description !");
                return;
            }
        }