Aracılığıyla paylaş


References.Item Yöntem

Dizinlenmiş bir fonksiyonu Reference nesne.

Ad alanı:  VSLangProj
Derleme:  VSLangProj (VSLangProj.dll içinde)

Sözdizimi

'Bildirim
Function Item ( _
    index As Object _
) As Reference
Reference Item(
    Object index
)
Reference^ Item(
    [InAttribute] Object^ index
)
abstract Item : 
        index:Object -> Reference
function Item(
    index : Object
) : Reference

Parametreler

Dönüş Değeri

Tür: VSLangProj.Reference
Döndürür bir Reference nesne.

Notlar

Belirli bir nesneyi almak için kullanılan bu yöntem References koleksiyonu.Öğeler eklendiğinde veya topluluktan silinmiş olduğundan, bir koleksiyonu belirli bir dizin numarasını her zaman aynı maddeye işaret edecek hiçbir garantisi yoktur.Koleksiyon için dizin numaralarını kullanarak tüm topluluk içinde yineleme yapma yararlıdır ve hiçbir öğe eklendiğinde veya yineleme sırasında silinmiş.

Örnekler

' 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 Güvenliği

Ayrıca bkz.

Başvuru

References Arabirim

VSLangProj Ad Alanı