ZennoLab Assemblies Documentation
Insert Method
See Also  Example Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > DocumentCollection Class : Insert Method
document

Type: document

The document to insert.

index

Type: System.Int32

The zero-based index at which document should be inserted.

Glossary Item Box

Inserts a document into the DocumentCollection at the specified index.

Syntax

C# 
public void Insert( 
   Document document,
   int index
)

Parameters

document

Type: document

The document to insert.

index

Type: System.Int32

The zero-based index at which document should be inserted.

Remarks

If index is equal to Count, item is added to the end of DocumentCollection.

Example

The following code example demonstrates the Insert method, along with various other properties and methods of the DocumentCollection.
C#Copy Code
DocumentCollection docCol = tab.AllDocuments;
            
Document doc = tab.MainDocument;
            
if (docCol.Count <= 0) return -1;
            
int index = docCol.Count / 2;
            
docCol.Insert(doc,index);
PHPCopy Code
$docCol = $tab->AllDocuments;
            
$doc = $tab->MainDocument;
            
if ($docCol->Count <= 0) return -1;
            
$index = $docCol->Count / 2;
            
$docCol->Insert($doc,$index);

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.