예제 #1
0
        /// <summary>
        /// See <see cref="Visitor.VisitTypeParam"/>.
        /// </summary>
        public override void VisitTypeParam(TypeParam typeParam)
        {
            if (delegates.VisitTypeParam != null)
            {
                delegates.VisitTypeParam(typeParam);
            }

            base.VisitTypeParam(typeParam);
        }
예제 #2
0
파일: Visitor.cs 프로젝트: liwq-net/NuDoq
 /// <summary>
 /// Visits the <c>typeparam</c> documentation element.
 /// </summary>
 public virtual void VisitTypeParam(TypeParam typeParam) => VisitContainer(typeParam);
예제 #3
0
파일: DocReader.cs 프로젝트: xoofx/NuDoq
        /// <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);
                }
            }
        }
예제 #4
0
파일: XmlVisitor.cs 프로젝트: xoofx/NuDoq
 /// <summary>
 /// Visits the <c>typeparam</c> documentation element.
 /// </summary>
 public override void VisitTypeParam(TypeParam typeParam)
 {
     AddXml("typeparam", "name", typeParam.Name, typeParam, base.VisitTypeParam);
 }