XmlDocRepository 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 XmlDocRepository : IXmlDocResolver
Inheritance
Implements

Remarks

The XmlDocRepository 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.

This repository 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
The repository 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 repository 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

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

Properties

ErrorHandlerGets or sets the error handler for the repository.
HasDocumentationGets a value indicating whether the XML documentation repository has any documentation available.
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.
TryGetXmlDoc(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.