TopicCollection.TryGetByFilePath Method

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

Definition

Attempts to lookup a file-backed topic in the topic hierarchy by its full path.
public bool TryGetByFilePath(string filePath, [NotNullWhen(true)] out TopicModel topic)

Parameters

filePath string
The exact file path of the topic to lookup.
topic TopicModel
When this method returns, contains the topic if found; otherwise, null.

Returns

bool
true if the topic was found; otherwise, false.

Exceptions

ArgumentNullException
Thrown when filePath is null.

Remarks

This method looks for a file-backed topic in the collection that exactly has the specified file path as its source in constant time O(1).

Lookup is performed in a case-insensitive manner and directory separators can be either slash ('/') or backslash ('\').

See Also