Represents a collection of Document objects.
Public Class DocumentDocuments
Inherits LeadCollection(Of Document)
public class DocumentDocuments extends LeadCollection<DocumentDocument>
DocumentDocuments derives from LeadCollection<T> and this can implement [System.Collections.ObjectModel.Collection
1](https://msdn.microsoft.com/en-us/library/System.Collections.ObjectModel.Collection1.aspx). You can use any of the collection methods
to iterate through the documents. This collection is read-only however and you cannot add, remove or change the items. Instead, use Pages to add or remove
pages that belong to a document separate from this one. The Document.Documents collection will automatically get updated to reflect what child
documents are currently held in the document.
Here is an example that shows what happens to Document.Documents when pages are added and removed:
When document (
virtualDocument is created, Document.Documents is an empty collection.
The user creates a new empty page using CreatePage of
virtualDocument and then adds it to the
Document.Pages collection. The Document.Documents collection will still be an empty
collection since the page's original owner is the same document (in other words, DocumentPage.Document is
The user removes the last page from
The Document.Documents collection will contain the single item
The user removes all the pages from
virtualDocument. The Document.Documents collection will be empty.
When Document.SaveToCache is called, the document will store the IDs of all the child documents.
When DocumentFactory.LoadFromCache is called, the document will try to re-load all the child documents and automatically add them into this collection. If any document fails to load or is no longer available in the cache, then all of its pages are removed automatically and are not loaded.
When the document is disposed, the value of AutoDisposeDocuments is examined, and if it is true, then all the child documents are disposed as well.
For an example, refer to DocumentFactory.Create.