←Select platform

DocumentDocuments Class

Summary

Represents a collection of LEADDocument objects.

Syntax
C#
VB
Java
C++
[CollectionDataContractAttribute()] 
public class DocumentDocuments : LeadCollection<LEADDocument> 
<CollectionDataContractAttribute()>  
Public Class DocumentDocuments 
   Inherits LeadCollection(Of LEADDocument) 
public [CollectionDataContractAttribute] 
   ref class DocumentDocuments : LeadCollection<LEADDocument^> 
public class DocumentDocuments extends LeadCollection<DocumentDocument> 

Remarks

DocumentDocuments manages the children of the document. It can be accessed through the Documents property of LEADDocument.

DocumentDocuments derives from LeadCollection<T> and this can implement [System.Collections.ObjectModel.Collection1](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 LEADDocument.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 LEADDocument.Documents when pages are added and removed:

  1. When document (virtualDocument is created, LEADDocument.Documents is an empty collection.

  2. The user creates a new empty page using CreatePage of virtualDocument and then adds it to the LEADDocument.Pages collection. The LEADDocument.Documents collection will still be an empty collection since the page's original owner is the same document (in other words, DocumentPage.Document is virtualDocument).

  3. The user adds a page from another document (document1) into LEADDocument.Pages of virtualDocument. The LEADDocument.Documents collection will contain a single item: document1

  4. The user adds another page from document1 into LEADDocument.Pages of virtualDocument. The LEADDocument.Documents collection will still contain the single item document1 since both pages have the same owner.

  5. The user adds a page from document2 into LEADDocument.Pages of virtualDocument. The LEADDocument.Documents collection will contain two items: document1 and document2.

  6. The user removes the last page from virtualDocument. The LEADDocument.Documents collection will contain the single item document1.

  7. The user removes all the pages from virtualDocument. The LEADDocument.Documents collection will be empty.

When LEADDocument.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. If it is true, then all the child documents are disposed as well.

Example

For an example, refer to DocumentFactory.Create.

Requirements

Target Platforms

Help Version 20.0.2019.4.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly