References.Find 메서드

프로젝트의 참조를 검색하여 지정된 Identity가 있는 개체를 찾습니다.

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

구문

‘선언
Function Find ( _
    bstrIdentity As String _
) As Reference
Reference Find(
    string bstrIdentity
)
Reference^ Find(
    [InAttribute] String^ bstrIdentity
)
abstract Find : 
        bstrIdentity:string -> Reference 
function Find(
    bstrIdentity : String
) : Reference

매개 변수

반환 값

형식: VSLangProj.Reference
Reference 개체를 반환합니다.

설명

References 컬렉션의 각 Reference 개체에는 Identity 속성이 있습니다. Find 메서드는 지정된 Identity가 있는 Reference 개체를 검색하여 반환합니다.

예제

' 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   

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

References 인터페이스

VSLangProj 네임스페이스