Example #1
0
        public string GetEnumDesc(Type enumType, string enumName)
        {
            foreach (var xPathNavigator in _xmlList)
            {
                var dec       = "";
                var commentId = XmlCommentsIdHelper.GetCommentIdForEnum(enumType, enumName);
                var typeNode  = xPathNavigator.SelectSingleNode(string.Format(MemberXPath, commentId));

                var summaryNode = typeNode?.SelectSingleNode(SummaryTag);
                if (summaryNode != null)
                {
                    dec = XmlCommentsTextHelper.Humanize(summaryNode.InnerXml);
                }

                if (!string.IsNullOrWhiteSpace(dec))
                {
                    return(dec);
                }
            }
            return(string.Empty);
        }
Example #2
0
        public string GetFuncDec(MethodInfo methodInfo)
        {
            foreach (var xPathNavigator in _xmlList)
            {
                var dec       = "";
                var commentId = XmlCommentsIdHelper.GetCommentIdForMethod(methodInfo);
                var typeNode  = xPathNavigator.SelectSingleNode(string.Format(MemberXPath, commentId));

                var summaryNode = typeNode?.SelectSingleNode(SummaryTag);
                if (summaryNode != null)
                {
                    dec = XmlCommentsTextHelper.Humanize(summaryNode.InnerXml);
                }

                if (!string.IsNullOrWhiteSpace(dec))
                {
                    return(dec);
                }
            }
            return(string.Empty);
        }