CodeParameterDeclarationExpressionCollection.IndexOf Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the index in the collection of the specified CodeParameterDeclarationExpression, if it exists in the collection.
public:
int IndexOf(System::CodeDom::CodeParameterDeclarationExpression ^ value);
public int IndexOf (System.CodeDom.CodeParameterDeclarationExpression value);
member this.IndexOf : System.CodeDom.CodeParameterDeclarationExpression -> int
Public Function IndexOf (value As CodeParameterDeclarationExpression) As Integer
Parameters
The CodeParameterDeclarationExpression to locate in the collection.
Returns
The index in the collection of the specified object, if found; otherwise, -1.
Examples
The following example searches for the presence of a specific CodeParameterDeclarationExpression instance and uses the IndexOf method to 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