References.Find(String) Método

Definição

Pesquisa as referências em um projeto para um objeto que tem o especificado Identity .

public:
 VSLangProj::Reference ^ Find(System::String ^ bstrIdentity);
public:
 VSLangProj::Reference ^ Find(Platform::String ^ bstrIdentity);
VSLangProj::Reference Find(std::wstring const & bstrIdentity);
[System.Runtime.InteropServices.DispId(5)]
public VSLangProj.Reference Find (string bstrIdentity);
[<System.Runtime.InteropServices.DispId(5)>]
abstract member Find : string -> VSLangProj.Reference
Public Function Find (bstrIdentity As String) As Reference

Parâmetros

bstrIdentity
String

Obrigatórios. O Identity do objeto Reference.

Retornos

Reference

Retorna um objeto Reference.

Atributos

Exemplos

' 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     

Comentários

Cada Reference objeto na References coleção tem um Identity . O Find método procura e retorna o Reference objeto com o especificado Identity .

Aplica-se a