XmlDocExtensions.Inspect Method

Namespace
Kampute.DocToolkit.XmlDoc
Assembly
  • Kampute.DocToolkit.dll

Definition

Inspects the XML documentation entry for missing or incomplete elements based on the provided member and inspection options.
public static IEnumerable<XmlDocInspectionIssue> Inspect(
	this XmlDocEntry doc,
	IMember member,
	XmlDocInspectionOptions options = XmlDocInspectionOptions.Required,
	Func<IMember, XmlDocEntry> overloadDocProvider = null)

Parameters

doc XmlDocEntry
The XML documentation entry to inspect.
member IMember
The member whose documentation is being inspected.
options XmlDocInspectionOptions optional
The options to determine which tags to inspect.
overloadDocProvider Func<IMember, XmlDocEntry> optional
An optional function to provide documentation for overload members when checking overload documentation.

Returns

IEnumerable<XmlDocInspectionIssue>
An enumerable of XmlDocInspectionIssue instances representing the issues found.

Exceptions

ArgumentNullException
Thrown when doc or member is null.

Remarks

This method inspects the XML documentation entry for completeness based on the member's characteristics and the specified inspection options.

The following elements are inspected based on the options flags:
XmlDocInspectionOptions.SummaryChecks for the presence of a non-empty <summary> tag.
XmlDocInspectionOptions.RemarksChecks for the presence of the <remarks> tag with non-empty content.
XmlDocInspectionOptions.ExampleChecks for the presence of the <example> tag with non-empty content.
XmlDocInspectionOptions.TypeParamChecks that each type parameter of generic members has a corresponding <typeparam> tag with non-empty description.
XmlDocInspectionOptions.ParamChecks that each parameter for members with parameters has a corresponding <param> tag with non-empty description.
XmlDocInspectionOptions.ReturnsChecks for the presence of the <returns> tag with non-empty description for members with return values.
XmlDocInspectionOptions.ValueFor properties, checks for the presence of the <value> tag with non-empty content.
XmlDocInspectionOptions.ExceptionValidates that all <exception> tags have non-empty descriptions.
XmlDocInspectionOptions.PermissionValidates that all <permission> tags have non-empty descriptions.
XmlDocInspectionOptions.EventValidates that all <event> tags have non-empty descriptions.
XmlDocInspectionOptions.ThreadSafetyFor composite types (classes, structs), checks for the presence of the <threadsafety> tag with either non-empty content or having values for at least one of instance and static attributes.
XmlDocInspectionOptions.SeeAlsoChecks that all <seealso> tags referencing hyperlinks have descriptive text.
XmlDocInspectionOptions.OverloadsFor members with overloads, checks for the presence of the <overloads> tag. If the tag is missing or empty, uses the provided overloadDocProvider function to check documentation of each overload. If the <overloads> tag is missing or empty in all overloads, an issue is reported. If overloadDocProvider is null, only the presence of the <overloads> tag in the current member is checked.
Enum value fields are only checked for the <summary> tag if the XmlDocInspectionOptions.Summary option is specified; other tags are not applicable and thus not inspected.