CodeParameterDeclarationExpressionCollection.IndexOf 메서드

정의

지정한 CodeParameterDeclarationExpression의 컬렉션에 인덱스가 있는 경우 해당 인덱스를 가져옵니다.

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

매개 변수

반환

지정된 개체의 컬렉션에 인덱스가 있으면 반환 값은 해당 인덱스이고 그렇지 않으면 -1입니다.

예제

다음 예제에서는 특정 CodeParameterDeclarationExpression instance 있는지 검색하고 메서드를 IndexOf 사용하여 발견된 인덱스 값을 가져옵니다.

// 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

적용 대상

추가 정보