コード例 #1
0
ファイル: TextVisitor.cs プロジェクト: xoofx/NuDoq
 public override void VisitParamRef(ParamRef paramRef)
 {
     base.VisitParamRef(paramRef);
     if (!string.IsNullOrEmpty(paramRef.Name))
     {
         builder.Append(paramRef.Name);
     }
 }
コード例 #2
0
ファイル: DelegateVisitor.cs プロジェクト: xoofx/NuDoq
        /// <summary>
        /// See <see cref="Visitor.VisitParamRef"/>.
        /// </summary>
        public override void VisitParamRef(ParamRef paramRef)
        {
            if (delegates.VisitParamRef != null)
            {
                delegates.VisitParamRef(paramRef);
            }

            base.VisitParamRef(paramRef);
        }
コード例 #3
0
ファイル: Visitor.cs プロジェクト: liwq-net/NuDoq
 /// <summary>
 /// Visits the <c>paramref</c> documentation elemnet.
 /// </summary>
 public virtual void VisitParamRef(ParamRef paramRef) => VisitElement(paramRef);
コード例 #4
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);
                }
            }
        }
コード例 #5
0
ファイル: XmlVisitor.cs プロジェクト: xoofx/NuDoq
 /// <summary>
 /// Visits the <c>paramref</c> documentation elemnet.
 /// </summary>
 public override void VisitParamRef(ParamRef paramRef)
 {
     AddXml("paramref", "name", paramRef.Name, paramRef, base.VisitParamRef);
 }