ZennoLab Assemblies Documentation
IndexOf Method (DocumentCollection)
Example 

Type: document

The document to locate in the DocumentCollection.

Searches for the specified object and returns the zero-based index of the first occurrence within the entire DocumentCollection.
Syntax
public int IndexOf( 
   Document document
)

Parameters

document

Type: document

The document to locate in the DocumentCollection.

Return Value

Type: System.Int32

The zero-based index of the first occurrence of item within the entire DocumentCollection, if found; otherwise, –1.

Exceptions
ExceptionDescription
ArgumentOutOfRangeExceptionindex is less than 0 or index is greater than Count.
Remarks
The DocumentCollection is searched forward starting at index and ending at the last element.
Example
The following code example demonstrates uses of the IndexOf method.
// get main document
Document doc = tab.MainDocument;
 
// get index of main document in document collection of current web page
int index = docCol.IndexOf(doc);
// get main document
$doc = $tab->MainDocument;
 
// get index of main document in document collection of current web page
$index = $docCol->IndexOf($doc);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

DocumentCollection Class
DocumentCollection Members
GetByNumber Method
Count Property

Send Feedback