Ejemplo n.º 1
0
 private bool NeedsResolving(CommonComments comments)
 {
     return(comments?.Inheritdoc != null &&
            string.IsNullOrEmpty(comments.Summary) &&
            string.IsNullOrEmpty(comments.Remarks) &&
            string.IsNullOrEmpty(comments.Example));
 }
Ejemplo n.º 2
0
 private void GetCommonComments(CommonComments comments, XPathNavigator rootNode)
 {
     comments.Summary    = GetSummaryComment(rootNode);
     comments.Remarks    = GetRemarksComment(rootNode);
     comments.Example    = GetExampleComment(rootNode);
     comments.Inheritdoc = GetInheritdocTag(rootNode);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Returns comments for specified class member.
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public CommonComments GetMemberComments(MemberInfo memberInfo)
        {
            var comments = new CommonComments();
            var node     = GetXmlMemberNode(memberInfo.MemberId(), memberInfo?.ReflectedType);

            return(GetComments(memberInfo, comments, node));
        }
Ejemplo n.º 4
0
        protected CommonComments GetComments(MemberInfo memberInfo, CommonComments comments, XPathNavigator node)
        {
            if (node == null)
            {
                return(comments);
            }

            GetCommonComments(comments, node);
            comments = ResolveInheritdocComments(comments, memberInfo);
            return(comments);
        }
Ejemplo n.º 5
0
 private CommonComments ResolveInheritdocComments(CommonComments comments, MemberInfo memberInfo)
 {
     if (!NeedsResolving(comments))
     {
         return(comments);
     }
     // If an explicit cref attribute is specified, the documentation from
     // the specified namespace/type/member is inherited.
     GetCrefComments(comments.Inheritdoc.Cref, memberInfo.DeclaringType, comments,
                     (node) => GetComments(memberInfo, comments, node));
     return(comments);
 }
Ejemplo n.º 6
0
        private bool GetCrefComments(string cref, Type typeForAssembly, CommonComments comments,
                                     Action <XPathNavigator> getCommentAction)
        {
            if (string.IsNullOrEmpty(cref))
            {
                return(false);
            }
            var typeNode   = GetXmlMemberNode(cref, typeForAssembly, true);
            var inheritdoc = comments.Inheritdoc;

            comments.Inheritdoc = null;
            getCommentAction(typeNode);
            comments.Inheritdoc = inheritdoc;
            return(true);
        }