DocumentUrlContextManager Class

Namespace
Kampute.DocToolkit.Routing
Assembly
  • Kampute.DocToolkit.dll

Definition

Represents the base class for managing document-specific URL contexts for adjusting cross-document relative links.
public abstract class DocumentUrlContextManager : IDocumentUrlContextProvider
Inheritance
  • object
  • DocumentUrlContextManager
Implements
Inherited by

Remarks

This abstract class implements the Template Method pattern to handle relative URL adjustment in generated documentation. It maintains a context hierarchy that ensures proper URL resolution regardless of a document's location in the documentation structure.

When extending this class, implement the CreateScope(string, IDocumentModel) method to provide a custom DocumentUrlContext that defines how URLs are adjusted based on your specific requirements.

The class manages nested scopes in a thread-safe manner, supporting concurrent documentation processing. Scopes are cached by directory path to minimize overhead when frequently accessing the same directories in the documentation structure.

Implementations of the scope should be stateless, thread-safe, and extend DocumentUrlContext to ensure proper scope life cycle management through the hierarchy.

Thread Safety

All public members of the type are guaranteed to be thread-safe.

Constructors

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

Properties

ActiveScopeGets the currently active URL context.

Methods

BeginScope(string, IDocumentModel)Creates a scoped URL context for the specified document path and model.
CreateScope(string, IDocumentModel)Creates a new scope for the specified directory path and document model.
EndScope(DocumentUrlContextManager.UrlContext)Ends the current URL context and restores the previous context.

See Also