ClassDocumentRepositoryRegistry
Provides a registry for associating document types with their corresponding document repositories.
Definition
Namespace:Telerik.Documents.AI.Tools.Core
Assembly:Telerik.Documents.AI.Tools.Core.dll
Syntax:
public class DocumentRepositoryRegistry
Inheritance: objectDocumentRepositoryRegistry
Constructors
DocumentRepositoryRegistry()
Declaration
public DocumentRepositoryRegistry()
Methods
RegisterRepository(DocumentType, IDocumentRepository)
Registers the specified document repository for the given document type.
Declaration
public void RegisterRepository(DocumentType documentType, IDocumentRepository repository)
Parameters
documentType
The type of document for which the repository is being registered.
repository
The repository instance to associate with the specified document type. Cannot be null.
Exceptions
Thrown if repository is null.
TryGetRepository(DocumentType, out IDocumentRepository)
Attempts to retrieve the repository associated with the specified document type.
Declaration
public bool TryGetRepository(DocumentType documentType, out IDocumentRepository repository)
Parameters
documentType
The type of document for which to retrieve the repository.
repository
When this method returns, contains the repository associated with the specified document type, if found; otherwise, null. This parameter is passed uninitialized.
Returns
true if a repository for the specified document type was found; otherwise, false.
Remarks
This method does not throw an exception if the repository is not found. Use the returned Boolean value to determine whether the repository was successfully retrieved.