コード例 #1
0
        public override void UpdateMemberSeeAlso(XElement mdoc, bool clean)
        {
            XElement mdDocs = mdoc.Element("Docs");

            if (clean)
            {
                foreach (XElement e in mdDocs.Elements("altmember").ToList())
                {
                    e.Remove();
                }
            }

            if (seealso_node == null)
            {
                return;
            }

            foreach (XElement pe in seealso_node.ElementsAfterSelf().TakeWhile(e => e.Name.LocalName == "dd"))
            {
                XElement link = pe.Element("a");
                if (link == null)
                {
                    continue;
                }

                // FIXME: CrefFromHref() is valid only for DroidDoc. It needs to be rewritten.
                string cref = Mdoc.CrefFromHref(link.Attribute("href").Value);
                if (cref.Length > 0 && cref [0] == '!')
                {
                    continue;
                }

                mdDocs.Add(new XElement("altmember", new XAttribute("cref", cref)));
            }
        }
コード例 #2
0
        public override void UpdateMemberExceptions(XElement mdoc, bool clean)
        {
            if (exception_node == null)
            {
                return;
            }

            XElement mdDocs = mdoc.Element("Docs");

            if (clean)
            {
                foreach (XElement e in mdDocs.Elements("exception").ToList())
                {
                    e.Remove();
                }
            }

            foreach (XElement jdp in exception_node.ElementsAfterSelf().TakeWhile(e => e.Name.LocalName == "dd"))
            {
                XElement type = jdp.Descendants("a").FirstOrDefault();
                if (type != null)
                {
                    mdDocs.Add(new XElement("exception",
                                            new XAttribute("cref", Mdoc.CrefFromHref(type.Attribute("href").Value)),
                                            Mdoc.FromHtml(ExceptionDocs(type))));
                }
            }
        }
コード例 #3
0
        public override void UpdateMemberSeeAlso(XElement mdoc, bool clean)
        {
            XElement jd = Section;

            XElement mdDocs = mdoc.Element("Docs");

            if (clean)
            {
                foreach (XElement e in mdDocs.Elements("altmember").ToList())
                {
                    e.Remove();
                }
            }

            XElement jdSeeAlso = GetJavaDocSection(jd, "See Also");

            if (jdSeeAlso == null)
            {
                return;
            }

            foreach (XElement jdp in jdSeeAlso.ElementsAfterSelf("ul").Elements("li").Elements("code"))
            {
                XElement link = jdp.Element("a");
                if (link == null)
                {
                    continue;
                }

                string cref = Mdoc.CrefFromHref(link.Attribute("href").Value);
                if (cref.Length > 0 && cref [0] == '!')
                {
                    continue;
                }

                mdDocs.Add(new XElement("altmember", new XAttribute("cref", cref)));
            }
        }
コード例 #4
0
        public override void UpdateMemberExceptions(XElement mdoc, bool clean)
        {
            XElement jd = Section;

            XElement jdThrows = GetJavaDocSectionTable(jd, "Throws");

            if (jdThrows == null)
            {
                return;
            }

            XElement mdDocs = mdoc.Element("Docs");

            if (clean)
            {
                foreach (XElement e in mdDocs.Elements("exception").ToList())
                {
                    e.Remove();
                }
            }

            foreach (XElement jdp in jdThrows.Elements("tr").Elements("th"))
            {
                XElement type = jdp.Element("a");
                if (type != null)
                {
                    mdDocs.Add(new XElement("exception",
                                            new XAttribute("cref", Mdoc.CrefFromHref(type.Attribute("href").Value)),
                                            Mdoc.FromHtml(ExceptionDocs(type))));
                }
                else if ((type = jdp.Element("td")) != null)
                {
                    mdDocs.Add(new XElement("exception",
                                            new XAttribute("cref", Mdoc.CrefFromJavaType(type.Value.Trim())),
                                            Mdoc.FromHtml(ExceptionDocs(type))));
                }
            }
        }