Exemplo n.º 1
0
 public override void VisitSee(See see)
 {
     base.VisitSee(see);
     if (!string.IsNullOrEmpty(see.Cref))
     {
         builder.Append(see.Cref.Substring(2));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// See <see cref="Visitor.VisitSee"/>.
        /// </summary>
        public override void VisitSee(See see)
        {
            if (delegates.VisitSee != null)
            {
                delegates.VisitSee(see);
            }

            base.VisitSee(see);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Visits the <c>see</c> documentation element.
        /// </summary>
        public override void VisitSee(See see)
        {
            var element = new XElement("see");

            if (see.Cref != null)
            {
                element.Add(new XAttribute("cref", see.Cref));
            }
            if (see.Langword != null)
            {
                element.Add(new XAttribute("langword", see.Langword));
            }

            AddXml(element, see, base.VisitSee);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Visits the <c>see</c> documentation element.
 /// </summary>
 public virtual void VisitSee(See see) => VisitElement(see);
Exemplo n.º 5
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);
                }
            }
        }