Ejemplo n.º 1
0
        /// <summary>
        /// Extract documentation from XML included in ASDocs-enriched SWCs
        /// </summary>
        /// <param name="rawDocs"></param>
        private static void ParseDocumentation(ContentParser parser)
        {
            if (parser.Catalog != null)
            {
                MxmlFilter.AddCatalog(parser.Filename, parser.Catalog);
            }

            if (parser.Docs.Count > 0)
                foreach (string docFile in parser.Docs.Keys)
                {
                    if (docFile.EndsWith(".dita.xml"))
                        continue;
                    try
                    {
                        Match m = reDocFile.Match(docFile);
                        if (!m.Success) continue;
                        string package = m.Groups[1].Value;
                        Dictionary<string, DocItem> packageDocs = Docs.ContainsKey(package)
                            ? Docs[package]
                            : new Dictionary<string, DocItem>();

                        byte[] rawDoc = parser.Docs[docFile];
                        DocsReader dr = new DocsReader(rawDoc);
                        dr.Parse(packageDocs);

                        Docs[package] = packageDocs;
                    }
                    catch (Exception)
                    {
                    }
                }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Extract documentation from XML included in ASDocs-enriched SWCs
        /// </summary>
        /// <param name="rawDocs"></param>
        private static void ParseDocumentation(ContentParser parser)
        {
            if (parser.Catalog != null)
            {
                MxmlFilter.AddCatalog(parser.Filename, parser.Catalog);
            }

            if (parser.Docs.Count > 0)
            {
                foreach (string docFile in parser.Docs.Keys)
                {
                    if (docFile.EndsWith(".dita.xml"))
                    {
                        continue;
                    }
                    try
                    {
                        Match m = reDocFile.Match(docFile);
                        if (!m.Success)
                        {
                            continue;
                        }
                        string package = m.Groups[1].Value;
                        Dictionary <string, DocItem> packageDocs = Docs.ContainsKey(package)
                            ? Docs[package]
                            : new Dictionary <string, DocItem>();

                        byte[]     rawDoc = parser.Docs[docFile];
                        DocsReader dr     = new DocsReader(rawDoc);
                        dr.Parse(packageDocs);

                        Docs[package] = packageDocs;
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }