IReadOnlyTopicCollection.TryResolve Method

Namespace
Kampute.DocToolkit.Collections
Assembly
  • Kampute.DocToolkit.dll

Definition

Attempts to resolve a topic in the collection based on the provided reference string.
bool TryResolve(string reference, [NotNullWhen(true)] out TopicModel topic)

Parameters

reference string
The reference string used to identify the topic, such as a file path or identifier.
topic TopicModel
When this method returns, contains the resolved topic if found; otherwise, null.

Returns

bool
true if the topic was successfully resolved; otherwise, false.

Remarks

This method attempts to resolve a topic using the provided reference, which can be a file path or a topic identifier. If the reference is relative, it is resolved against the currently active model in the documentation context.

The resolution process first tries to find a file-backed topic by the given reference. If no such topic is found, it then attempts to find a topic by its identifier. The search is case-insensitive and directory separators can be either slash ('/') or backslash ('\').