References.Find メソッド

更新 : 2007 年 11 月

プロジェクトに含まれている参照の中から、指定した Identity を持つオブジェクトを検索します。

名前空間 :  VSLangProj
アセンブリ :  VSLangProj (VSLangProj.dll 内)

構文

'宣言
Function Find ( _
    bstrIdentity As String _
) As Reference
'使用
Dim instance As References
Dim bstrIdentity As String
Dim returnValue As Reference

returnValue = instance.Find(bstrIdentity)
Reference Find(
    string bstrIdentity
)
Reference^ Find(
    [InAttribute] String^ bstrIdentity
)
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   

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

References インターフェイス

References メンバ

VSLangProj 名前空間