Windows apps
Collapse the table of content
Expand the table of content
Information
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::Contains Method (CodeTypeDeclaration^)

 

Gets a value that indicates whether the collection contains the specified CodeTypeDeclaration object.

Namespace:   System.CodeDom
Assembly:  System (in System.dll)

public:
bool Contains(
	CodeTypeDeclaration^ value
)

Parameters

value
Type: System.CodeDom::CodeTypeDeclaration^

The CodeTypeDeclaration object to search for in the collection.

Return Value

Type: System::Boolean

true 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
Return to top
Show:
© 2017 Microsoft