Exemplo n.º 1
0
        /// <summary>Parses .Net XML documentation tag that contains attribute cref.</summary>
        /// <example><![CDATA[<exception cref="Namespace.ExceptionType">nested comments and/or plain text</exception>]]></example>
        /// <example><![CDATA[<permission cref="Namespace.Type">nested comments and/or plain text</permission>]]></example>
        public static new DotNetCommentQualifiedLink FromVisualStudioXml(XElement element)
        {
            DotNetCommentQualifiedLink link = FromVisualStudioXml(element.GetAttributeValue("cref"));

            link.Tag = DotNetComment.GetTag(element);
            return(link);
        }
        /// <summary>Parses .Net XML documentation for permission or exception.</summary>
        /// <example><![CDATA[<permission cref="Namespace.Type.Member">nested comments</permission>]]></example>
        /// <example><![CDATA[<exception cref="Namespace.ExceptionType">nested comments</exception>]]></example>
        public static new DotNetCommentQualifiedLinkedGroup FromVisualStudioXml(XElement element)
        {
            ValidateXmlTag(element, new string[] { "permission", "exception", "see", "seealso" });
            CommentTag tag = DotNetComment.GetTag(element);

            DotNetCommentQualifiedLink link     = DotNetCommentQualifiedLink.FromVisualStudioXml(element.GetAttributeValue("cref"));
            List <DotNetComment>       comments = ParseSection(element);

            if (link is DotNetCommentMethodLink)
            {
                return(new DotNetCommentMethodLinkedGroup(link as DotNetCommentMethodLink, tag, comments));
            }
            return(new DotNetCommentQualifiedLinkedGroup(link, tag, comments));
        }
 /// <summary>
 /// Returns true if member name matches the link name.
 /// </summary>
 public bool Matches(DotNetCommentQualifiedLink link)
 {
     return(this.Name == link.Name);
 }
 /// <summary></summary>
 public DotNetCommentQualifiedLinkedGroup(DotNetCommentQualifiedLink link, CommentTag tag, List <DotNetComment> comments) : base(link, comments)
 {
     Tag = tag;
 }
 /// <summary></summary>
 public DotNetCommentQualifiedLinkedGroup(DotNetCommentQualifiedLink link, CommentTag tag, params DotNetComment[] comments) : base(link, comments)
 {
     Tag = tag;
 }
 /// <summary></summary>
 public DotNetCommentQualifiedLinkedGroup(DotNetCommentQualifiedLink link, CommentTag tag, DotNetComment comment) : base(link, comment)
 {
     Tag = tag;
 }
Exemplo n.º 7
0
        /// <summary>Parses top-level .Net XML documentation comments. Returns null if no comments are found.</summary>
        /// <returns>Returns null if the element name is not recognized.</returns>
        public static DotNetComment FromVisualStudioXml(XElement element)
        {
            switch (element.Name.LocalName)
            {
            case "summary":
            case "remarks":
            case "example":
            case "para":                     //paragraph
            case "returns":
            case "value":
                DotNetCommentGroup group = DotNetCommentGroup.FromVisualStudioXml(element);
                if (group.IsEmpty)
                {
                    return(null);
                }
                return(group);

            case "exception":
            case "permission":
                if (element.Attribute("cref") == null)
                {
                    break;
                }
                if (String.IsNullOrEmpty(element.Attribute("cref").Value))
                {
                    break;
                }
                return(DotNetCommentQualifiedLinkedGroup.FromVisualStudioXml(element));

            case "see":
            case "seealso":
                if (element.Attribute("cref") == null)
                {
                    break;
                }
                if (String.IsNullOrEmpty(element.Attribute("cref").Value))
                {
                    break;
                }
                if (element.Nodes().Count() == 0)
                {
                    return(DotNetCommentQualifiedLink.FromVisualStudioXml(element));
                }
                else
                {
                    return(DotNetCommentQualifiedLinkedGroup.FromVisualStudioXml(element));
                }

            case "list":
                return(DotNetCommentList.FromVisualStudioXml(element));

            case "param":
                return(DotNetCommentParameter.FromVisualStudioXml(element));

            case "paramref":
                return(DotNetCommentParameterLink.FromVisualStudioXml(element));

            case "typeparam":
                return(DotNetCommentTypeParameter.FromVisualStudioXml(element));

            case "typeparamref":
                return(DotNetCommentTypeParameterLink.FromVisualStudioXml(element));

            case "c":                     //inline code
                return(DotNetCommentCode.FromVisualStudioXml(element));

            case "code":                     //code block
                return(DotNetCommentCodeBlock.FromVisualStudioXml(element));

            case "inheritdoc":
                return(new DotNetCommentInherit());

            case "duplicate":
                if (element.Attribute("cref") == null)
                {
                    break;
                }
                string duplicateCref = element.Attribute("cref").Value;
                if (String.IsNullOrEmpty(duplicateCref))
                {
                    break;
                }
                return(new DotNetCommentDuplicate(DotNetCommentQualifiedLink.FromVisualStudioXml(duplicateCref)));
            }
            return(null);
        }
Exemplo n.º 8
0
 /// <summary></summary>
 public DotNetCommentDuplicate(DotNetCommentQualifiedLink link) : base(link.Name)
 {
     Tag = CommentTag.Duplicate;
 }