Beispiel #1
0
        /// <summary>
        /// See <see cref="Visitor.VisitSeeAlso"/>.
        /// </summary>
        public override void VisitSeeAlso(SeeAlso seeAlso)
        {
            if (delegates.VisitSeeAlso != null)
            {
                delegates.VisitSeeAlso(seeAlso);
            }

            base.VisitSeeAlso(seeAlso);
        }
Beispiel #2
0
 /// <summary>
 /// Visits the <c>seealso</c> documentation element.
 /// </summary>
 public virtual void VisitSeeAlso(SeeAlso seeAlso) => VisitElement(seeAlso);
Beispiel #3
0
        /// <summary>
        /// Reads all supported documentation elements.
        /// </summary>
        private static IEnumerable <Element> ReadContent(XElement xml)
        {
            foreach (var node in xml.Nodes())
            {
                var element = default(Element);
                switch (node.NodeType)
                {
                case System.Xml.XmlNodeType.Element:
                    var elementNode = (XElement)node;
                    switch (elementNode.Name.LocalName)
                    {
                    case "summary":
                        element = new Summary(ReadContent(elementNode));
                        break;

                    case "remarks":
                        element = new Remarks(ReadContent(elementNode));
                        break;

                    case "example":
                        element = new Example(ReadContent(elementNode));
                        break;

                    case "para":
                        element = new Para(ReadContent(elementNode));
                        break;

                    case "param":
                        element = new Param(FindAttribute(elementNode, "name"), ReadContent(elementNode));
                        break;

                    case "paramref":
                        element = new ParamRef(FindAttribute(elementNode, "name"));
                        break;

                    case "typeparam":
                        element = new TypeParam(FindAttribute(elementNode, "name"), ReadContent(elementNode));
                        break;

                    case "typeparamref":
                        element = new TypeParamRef(FindAttribute(elementNode, "name"));
                        break;

                    case "code":
                        element = new Code(TrimCode(elementNode.Value));
                        break;

                    case "c":
                        element = new C(elementNode.Value);
                        break;

                    case "see":
                        element = new See(FindAttribute(elementNode, "cref"), FindAttribute(elementNode, "langword"), elementNode.Value, ReadContent(elementNode));
                        break;

                    case "seealso":
                        element = new SeeAlso(FindAttribute(elementNode, "cref"), elementNode.Value, ReadContent(elementNode));
                        break;

                    case "list":
                        element = new List(FindAttribute(elementNode, "type"), ReadContent(elementNode));
                        break;

                    case "listheader":
                        element = new ListHeader(ReadContent(elementNode));
                        break;

                    case "term":
                        element = new Term(ReadContent(elementNode));
                        break;

                    case "description":
                        element = new Description(ReadContent(elementNode));
                        break;

                    case "item":
                        element = new Item(ReadContent(elementNode));
                        break;

                    case "exception":
                        element = new Exception(FindAttribute(elementNode, "cref"), ReadContent(elementNode));
                        break;

                    case "value":
                        element = new Value(ReadContent(elementNode));
                        break;

                    case "returns":
                        element = new Returns(ReadContent(elementNode));
                        break;

                    default:
                        element = new UnknownElement(elementNode, ReadContent(elementNode));
                        break;
                    }
                    break;

                case System.Xml.XmlNodeType.Text:
                    element = new Text(TrimText(((XText)node).Value));
                    break;

                default:
                    break;
                }

                if (element != null)
                {
                    element.SetLineInfo(xml as IXmlLineInfo);
                    yield return(element);
                }
            }
        }
Beispiel #4
0
 /// <summary>
 /// Visits the <c>seealso</c> documentation element.
 /// </summary>
 public override void VisitSeeAlso(SeeAlso seeAlso)
 {
     AddXml("seealso", "cref", seeAlso.Cref, seeAlso, base.VisitSeeAlso);
 }