Поделиться через


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

Параметры

  • bstrIdentity
    Тип: String

    Обязательный. Identity объекта Reference.

Возвращаемое значение

Тип: VSLangProj.Reference
Возвращает объект Reference.

Заметки

Каждый объект Reference в коллекции References имеет свойство Identity. Метод Find выполняет поиск и возвращает объект Reference с указанным свойством Identity.

Примеры

' 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 - пространство имен