CodeCommentStatementCollection.IndexOf(CodeCommentStatement) 메서드

정의

컬렉션에 있는 경우 컬렉션에 지정된 CodeCommentStatement 개체의 인덱스를 가져옵니다.

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

매개 변수

value
CodeCommentStatement

CodeCommentStatement 찾을 개체입니다.

반품

컬렉션에서 지정된 개체의 인덱스(있는 경우)입니다. 그렇지 않으면 -1입니다.

예제

다음 예제에서는 특정 CodeCommentStatement 개체의 존재를 검색 하 고 발견 된 인덱스 값을 가져오기 위해 메서드를 사용 합니다 IndexOf .

// Tests for the presence of a CodeCommentStatement in the
// collection, and retrieves its index if it is found.
CodeCommentStatement testComment = new CodeCommentStatement("Test comment");
int itemIndex = -1;
if( collection.Contains( testComment ) )
    itemIndex = collection.IndexOf( testComment );
' Tests for the presence of a CodeCommentStatement in the 
' collection, and retrieves its index if it is found.
Dim testComment As New CodeCommentStatement("Test comment")
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
    itemIndex = collection.IndexOf(testComment)
End If

적용 대상

추가 정보