XmlDocProvider Class

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

Definition

Provides XML documentation for .NET types and members by parsing and resolving documentation files.
public class XmlDocProvider : IXmlDocProvider
Inheritance
Implements

Remarks

The XmlDocProvider is a central component in the documentation generation system that manages the loading, parsing, and resolution of XML documentation files. It serves as a repository of documentation content that can be queried by code reference or reflection member information.

This provider handles several key documentation processing tasks:
  • Loading XML documentation from files generated during compilation
  • Resolving external content referenced by include elements
  • Resolving inherited documentation via inheritdoc elements
  • Offering standardized access to documentation via code references or reflection
The provider uses lazy resolution for inheritdoc elements, meaning these elements are only resolved when documentation is actually requested. This approach ensures that inherited documentation is available even when documentation is loaded in a non-optimal order.

When handling error conditions, the provider uses a configurable error handler that can be customized through the ErrorHandler property. The default behavior is to silently ignore errors during resolution, except for missing included files which will throw a FileNotFoundException.

Constructors

XmlDocProvider()Initializes a new instance of the XmlDocProvider class.

Properties

ErrorHandlerGets or sets the error handler for the documentation content provider.
HasDocumentationGets a value indicating whether the XML documentation provider is empty.
MembersGets the dictionary of XML documentation elements.

Methods

Import(XDocument)Imports XML documentation of members from the specified XML document.
ImportFile(string)Imports XML documentation from the specified documentation file, resolving any include directives.
ResolveIncludes(XDocument, string)Resolves include elements in the specified XML document by importing content from external files.
ResolveInheritDoc(XElement)Resolves the inheritdoc elements in the specified XML element.
TryGetDoc(string, out XmlDocEntry)Attempts to retrieves the XML documentation for the specified code reference.
TryGetElement(string, out XElement)Attempts to retrieves the XML documentation element for the specified code reference.
TryResolveInheritedElement(XElement, XElement, out XElement)Attempts to resolve the inherited element for the specified inheritdoc element.

Extension Methods

InspectDocumentation(this IXmlDocProvider, IMember, XmlDocInspectionOptions)Inspects the XML documentation for the specified member.
TryGetMemberDoc(this IXmlDocProvider, IMember, out XmlDocEntry)Attempts to retrieves the XML documentation for the specified member.
TryGetNamespaceDoc(this IXmlDocProvider, string, out XmlDocEntry)Attempts to retrieves the XML documentation for the specified namespace.
WithCaching(this IXmlDocProvider)Wraps the specified IXmlDocProvider instance in a caching layer if it is not already cached.