CodeTypeDeclarationCollection::Contains Method (CodeTypeDeclaration^)
.NET Framework (current version)
Gets a value that indicates whether the collection contains the specified CodeTypeDeclaration object.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
System.CodeDom::CodeTypeDeclaration^
The CodeTypeDeclaration object to search for in the collection.
Return Value
Type: System::Booleantrue if the collection contains the specified object; otherwise, false.
The following example demonstrates how to use the Contains method to find a CodeTypeDeclaration object in a CodeTypeDeclarationCollection.
// 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: