Exemplo n.º 1
0
        /// <summary>Gets the description of the given member (based on the DescriptionAttribute, DisplayAttribute or XML Documentation).</summary>
        /// <param name="parameter">The parameter.</param>
        /// <param name="xmlDocsSettings">The XML Docs settings.</param>
        /// <returns>The description or null if no description is available.</returns>
        public static string GetDescription(this ContextualParameterInfo parameter, IXmlDocsSettings xmlDocsSettings)
        {
            var description = GetDescription(parameter.ContextAttributes);

            if (description != null)
            {
                return(description);
            }

            if (xmlDocsSettings.UseXmlDocumentation)
            {
                var summary = parameter.GetXmlDocs(xmlDocsSettings.ResolveExternalXmlDocumentation);
                if (summary != string.Empty)
                {
                    return(summary);
                }
            }

            return(null);
        }
Exemplo n.º 2
0
        /// <summary>Gets the description of the given member (based on the DescriptionAttribute, DisplayAttribute or XML Documentation).</summary>
        /// <param name="type">The member info</param>
        /// <param name="xmlDocsSettings">The XML Docs settings.</param>
        /// <returns>The description or null if no description is available.</returns>
        public static string GetDescription(this CachedType type, IXmlDocsSettings xmlDocsSettings)
        {
            var attributes = type is ContextualType contextualType ? contextualType.ContextAttributes : type.InheritedAttributes;

            var description = GetDescription(attributes);

            if (description != null)
            {
                return(description);
            }

            if (xmlDocsSettings.UseXmlDocumentation)
            {
                var summary = type.GetXmlDocsSummary(xmlDocsSettings.ResolveExternalXmlDocumentation);
                if (summary != string.Empty)
                {
                    return(summary);
                }
            }

            return(null);
        }
Exemplo n.º 3
0
 public ExtendedApiParameterDescription(IXmlDocsSettings xmlDocsSettings)
 {
     _xmlDocsSettings = xmlDocsSettings;
 }
Exemplo n.º 4
0
        /// <summary>Gets the description of the given member (based on the DescriptionAttribute, DisplayAttribute or XML Documentation).</summary>
        /// <param name="accessorInfo">The accessor info.</param>
        /// <param name="xmlDocsSettings">The XML Docs settings.</param>
        /// <returns>The description or null if no description is available.</returns>
        public static string GetDescription(this ContextualAccessorInfo accessorInfo, IXmlDocsSettings xmlDocsSettings)
        {
            var description = GetDescription(accessorInfo.AccessorType.Attributes);

            if (description != null)
            {
                return(description);
            }

            if (xmlDocsSettings.UseXmlDocumentation)
            {
                var summary = accessorInfo.MemberInfo.GetXmlDocsSummary(xmlDocsSettings.ResolveExternalXmlDocumentation);
                if (summary != string.Empty)
                {
                    return(summary);
                }
            }

            return(null);
        }