CodeTypeReferenceCollection.IndexOf(CodeTypeReference) 메서드

정의

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

public:
 int IndexOf(System::CodeDom::CodeTypeReference ^ value);
public int IndexOf (System.CodeDom.CodeTypeReference value);
member this.IndexOf : System.CodeDom.CodeTypeReference -> int
Public Function IndexOf (value As CodeTypeReference) As Integer

매개 변수

value
CodeTypeReference

컬렉션에서 찾을 CodeTypeReference입니다.

반환

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

예제

// Tests for the presence of a CodeTypeReference in the 
// collection, and retrieves its index if it is found.
CodeTypeReference^ testReference = gcnew CodeTypeReference( bool::typeid );
int itemIndex = -1;
if ( collection->Contains( testReference ) )
   itemIndex = collection->IndexOf( testReference );
// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference testReference = new CodeTypeReference(typeof(bool));
int itemIndex = -1;
if( collection.Contains( testReference ) )
    itemIndex = collection.IndexOf( testReference );
' Tests for the presence of a CodeTypeReference in the 
' collection, and retrieves its index if it is found.
Dim testReference As New CodeTypeReference(GetType(Boolean))
Dim itemIndex As Integer = -1
If collection.Contains(testReference) Then
    itemIndex = collection.IndexOf(testReference)
End If

적용 대상

추가 정보