VSProject.References – vlastnost
Získává References kolekce pro projekt.Jen pro čtení
Obor názvů: VSLangProj
Sestavení: VSLangProj (v VSLangProj.dll)
Syntaxe
'Deklarace
ReadOnly Property References As References
References References { get; }
property References^ References {
References^ get ();
}
abstract References : References with get
function get References () : References
Hodnota vlastnosti
Typ: VSLangProj.References
A References obsahující kolekci Reference objekty, každý z nich představuje odkaz.
Poznámky
K zapsat kód proti externí součásti že projektu musí nejprve obsahovat odkaz na tuto součást.Odkaz lze provést tři typy součástí:.NET sestavení automatizační servery COM a ovládací prvky a další projekty v rámci stejné řešení, které poskytují součásti.
Příklady
Visual Basic
' Macro Editor
' Assuming that the first project in the solution is a Visual Basic or C#
' application, this routine lists the references in the project.
Imports VSLangProj
Sub ListReferences()
' Retrieve the VSProject object.
Dim theVSProject As VSProject = _
CType(DTE.Solution.Projects.Item(1).Object, VSProject)
' Retrieve the references collection.
Dim refs As References = theVSProject.References
' Create a string list of the reference names.
Dim refList As String = ""
Dim aRef As Reference
For Each aRef In refs
refList &= aRef.Identity & ControlChars.CrLf
Next
MsgBox(refList)
End Sub
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.