Exemplo n.º 1
0
        public XmlCodeComment GetValue(CRefPath forMember)
        {
            if (forMember == null || !_isLoaded || forMember.PathType == CRefTypes.Error)
            {
                return(XmlCodeComment.Empty);
            }
            string xpath = $"/doc/members/member[@name='{forMember.ToString()}']/value";

            XmlCodeComment comment = FindCommentWithXPath(xpath);

            return(comment);
        }
Exemplo n.º 2
0
        private XmlCodeComment FindCommentWithXPath(string xpath)
        {
            XmlCodeComment comment    = XmlCodeComment.Empty;
            XmlNode        commentXml = FindXmlElement(xpath);

            if (commentXml != null)
            {
                try
                {
                    comment = new XmlCodeComment(commentXml);
                }
                catch (Exception ex)
                {
                    // we cant fix this problem but we do need to add more details
                    // to the exception
                    throw new XmlCommentException(commentXml.InnerXml, "An error occurred while parsing XML comments", ex);
                }
            }

            return(comment);
        }