| ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > DocumentCollection Class : Insert Method |
Type: document
The document to insert.
Type: System.Int32
The zero-based index at which document should be inserted.
Type: document
The document to insert.
Type: System.Int32
The zero-based index at which document should be inserted.
| Exception | Description |
|---|---|
| ArgumentOutOfRangeException | index is less than 0 or index is greater than Count. |
// get all documents DocumentCollection docCol = tab.AllDocuments; // get main document Document doc = tab.MainDocument; if (docCol.Count <= 0) return -1 int index = docCol.Count / 2; // insert main document to collection docCol.Insert(doc, index);
// get all documents $docCol = $tab->AllDocuments; // get main document $doc = $tab->MainDocument; if ($docCol->Count <= 0) return -1 $index = $docCol=>Count / 2; // insert main document to collection $docCol->Insert($doc, $index);
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven