Condividi tramite


Metodo References.Find

Cerca nei riferimenti di un progetto un oggetto che abbia la proprietà Identity specificata.

Spazio dei nomi:  VSLangProj
Assembly:  VSLangProj (in VSLangProj.dll)

Sintassi

'Dichiarazione
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

Parametri

Valore restituito

Tipo: VSLangProj.Reference
Restituisce un oggetto Reference.

Note

Ogni oggetto Reference nell'insieme References è dotato della proprietà Identity. Il metodo Find cerca e restituisce l'oggetto Reference con la proprietà Identity specificata.

Esempi

' 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   

Sicurezza di .NET Framework

Vedere anche

Riferimenti

References Interfaccia

Spazio dei nomi VSLangProj