CodeParameterDeclarationExpressionCollection.Contains Method

Definition

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

public:
 bool Contains(System::CodeDom::CodeParameterDeclarationExpression ^ value);
public bool Contains (System.CodeDom.CodeParameterDeclarationExpression value);
member this.Contains : System.CodeDom.CodeParameterDeclarationExpression -> bool
Public Function Contains (value As CodeParameterDeclarationExpression) As Boolean

Parameters

Returns

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

Examples

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 = gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" );
int itemIndex = -1;
if ( collection->Contains( testParameter ) )
   itemIndex = collection->IndexOf( testParameter );
// 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 );
' Tests for the presence of a CodeParameterDeclarationExpression 
' in the collection, and retrieves its index if it is found.
Dim testParameter As New CodeParameterDeclarationExpression(GetType(Integer), "testIntArgument")
Dim itemIndex As Integer = -1
If collection.Contains(testParameter) Then
    itemIndex = collection.IndexOf(testParameter)
End If

Applies to

See also