CodeParameterDeclarationExpressionCollection.IndexOf Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Lekéri az indexet a megadott CodeParameterDeclarationExpressiongyűjteményben, ha létezik a gyűjteményben.
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éterek
A CodeParameterDeclarationExpression gyűjteményben keresendő.
Válaszok
A megadott objektum gyűjteményében lévő index, ha megtalálható; ellenkező esetben -1.
Példák
Az alábbi példa egy adott CodeParameterDeclarationExpression példány jelenlétét keresi, és a IndexOf metódussal lekéri azt az indexértéket, amelynél a példány megtalálható.
// 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