private static XElement GetXmlDocumentation(this MemberInfo member, XDocument xml)
        {
            var name   = GetMemberElementName(member);
            var result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']");

            return(result.OfType <XElement>().FirstOrDefault());
        }
        private static string GetXmlDocumentation(this MemberInfo member, XDocument xml, string tagName)
        {
            var name          = GetMemberElementName(member);
            var documentation = DynamicApis.XPathEvaluate(xml, string.Format("string(/doc/members/member[@name='{0}']/" + tagName + ")", name)).ToString().Trim();

            return(RemoveLineBreakWhiteSpaces(documentation));
        }
Beispiel #3
0
        private static async Task <XElement> GetXmlDocumentationAsync(this ParameterInfo parameter, XDocument xml)
        {
            var name   = GetMemberElementName(parameter.Member);
            var result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']");

            var element = result.OfType <XElement>().FirstOrDefault();

            if (element != null)
            {
                await ReplaceInheritdocElementsAsync(parameter.Member, element).ConfigureAwait(false);

                if (parameter.IsRetval || string.IsNullOrEmpty(parameter.Name))
                {
                    result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']/returns");
                }
                else
                {
                    result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']/param[@name='{parameter.Name}']");
                }

                return(result.OfType <XElement>().FirstOrDefault());
            }

            return(null);
        }
        private static XElement GetXmlDocumentation(this ParameterInfo parameter, XDocument xml)
        {
            IEnumerable result;

            var name = GetMemberElementName(parameter.Member);

            if (parameter.IsRetval || string.IsNullOrEmpty(parameter.Name))
            {
                result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']/returns");
            }
            else
            {
                result = (IEnumerable)DynamicApis.XPathEvaluate(xml, $"/doc/members/member[@name='{name}']/param[@name='{parameter.Name}']");
            }

            return(result.OfType <XElement>().FirstOrDefault());
        }
        private static string GetXmlDocumentation(this ParameterInfo parameter, XDocument xml)
        {
            string documentation;

            var name = GetMemberElementName(parameter.Member);

            if (parameter.IsRetval || string.IsNullOrEmpty(parameter.Name))
            {
                documentation = DynamicApis.XPathEvaluate(xml, string.Format("string(/doc/members/member[@name='{0}']/returns)", name)).ToString().Trim();
            }
            else
            {
                documentation = DynamicApis.XPathEvaluate(xml, string.Format("string(/doc/members/member[@name='{0}']/param[@name='{1}'])", name, parameter.Name)).ToString().Trim();
            }

            return(RemoveLineBreakWhiteSpaces(documentation));
        }