CodeParameterDeclarationExpressionCollection.IndexOf Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient l’index dans la collection de l’objet spécifié CodeParameterDeclarationExpression, s’il existe dans la 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
Paramètres
À CodeParameterDeclarationExpression localiser dans la collection.
Retours
Index dans la collection de l’objet spécifié, s’il est trouvé ; sinon, -1.
Exemples
L’exemple suivant recherche la présence d’une instance spécifique CodeParameterDeclarationExpression et utilise la IndexOf méthode pour obtenir la valeur d’index à laquelle elle a été trouvée.
// 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