The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
CodeTypeDeclarationCollection::IndexOf Method (CodeTypeDeclaration^)
.NET Framework (current version)
Gets the index of the specified CodeTypeDeclaration object in the CodeTypeDeclarationCollection, if it exists in the collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
System.CodeDom::CodeTypeDeclaration^
The CodeTypeDeclaration to locate in the collection.
Return Value
Type: System::Int32The index of the specified object, if it is found, in the collection; otherwise, -1.
The following example retrieves CodeTypeDeclaration entries from a CodeTypeDeclarationCollection object and displays their names and indexes returned by the IndexOf method.
// Tests for the presence of a CodeTypeDeclaration in the // collection, and retrieves its index if it is found. CodeTypeDeclaration^ testDeclaration = gcnew CodeTypeDeclaration( "TestType" ); int itemIndex = -1; if ( collection->Contains( testDeclaration ) ) itemIndex = collection->IndexOf( testDeclaration );
.NET Framework
Available since 1.1
Available since 1.1
Show: