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, ASDocItem> packageDocs = Docs.ContainsKey(package)
                            ? Docs[package]
                            : new Dictionary<string, ASDocItem>();

                        byte[] rawDoc = parser.Docs[docFile];
                        ASDocsReader dr = new ASDocsReader(rawDoc);
                        dr.ExcludedASDocs = ExcludedASDocs;
                        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, ASDocItem> packageDocs = Docs.ContainsKey(package)
                            ? Docs[package]
                            : new Dictionary <string, ASDocItem>();

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

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