CodeParameterDeclarationExpressionCollection.Contains Method (CodeParameterDeclarationExpression)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a value indicating whether the collection contains the specified CodeParameterDeclarationExpression.

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

public bool Contains(
	CodeParameterDeclarationExpression value


Type: System.CodeDom.CodeParameterDeclarationExpression

A CodeParameterDeclarationExpression to search for in the collection.

Return Value

Type: System.Boolean

true if the collection contains the specified object; otherwise, false.

The following example uses the Contains method to search for the presence of a specific CodeParameterDeclarationExpression object and get the index value at which it was found.

// Tests for the presence of a CodeParameterDeclarationExpression 
// in the collection, and retrieves its index if it is found.
CodeParameterDeclarationExpression testParameter = new CodeParameterDeclarationExpression(typeof(int), "testIntArgument");
int itemIndex = -1;
if( collection.Contains( testParameter ) )
    itemIndex = collection.IndexOf( testParameter );

.NET Framework
Available since 1.1
Return to top