Share via


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 名前空間