다음을 통해 공유


References.Item 메서드

인덱싱된 Reference 개체를 반환합니다.

네임스페이스: VSLangProj
어셈블리: VSLangProj(vslangproj.dll)

구문

‘선언
‘사용 방법

매개 변수

반환 값

Reference 개체를 반환합니다.

설명

이 메서드는 References 컬렉션에서 특정 개체를 검색하는 데 사용됩니다. 컬렉션에서 항목이 추가되거나 삭제될 수 있기 때문에 컬렉션의 지정된 인덱스 번호가 항상 동일한 항목을 가리킨다고 볼 수는 없습니다. 컬렉션의 인덱스 번호는 전체 컬렉션을 반복할 때 항목이 추가되거나 삭제되지 않는 경우에 유용합니다.

예제

' Macro Editor
Imports VSLangProj
Public Sub FindExample()
   ' First project is a Visual Basic or C# project.
   Dim theVSProject As VSProject = _
      CType(DTE.Solution.Projects.Item(1).Object, VSProject)
        
   Dim refs As References = theVSProject.References
   Dim firstIdentity As String = refs.Item(1).Identity
   Dim firstRef As Reference = refs.Find(firstIdentity)
   ' Are they the same object?
   Dim isSame As Boolean = (firstRef.Identity = refs.Item(1).Identity)
   MsgBox("Are they the same? " & isSame.ToString())
End Sub    

참고 항목

참조

References 인터페이스
References 멤버
VSLangProj 네임스페이스