VSProjectItem.DTE-Eigenschaft
Gibt das oberste Erweiterbarkeitsobjekt zurück.
Namespace: VSLangProj
Assembly: VSLangProj (in VSLangProj.dll)
Syntax
'Declaration
ReadOnly Property DTE As DTE
DTE DTE { get; }
property DTE^ DTE {
DTE^ get ();
}
abstract DTE : DTE with get
function get DTE () : DTE
Eigenschaftswert
Typ: DTE
Gibt ein DTE-Objekt zurück.
Hinweise
In Visual Studio ist das DTE-Objekt das Stammobjekt des Automatisierungsmodells, das in anderen Objektmodellen häufig als "Application" bezeichnet wird.
Beispiele
Public Sub PrjDTE(ByVal dte As DTE2)
' List the parent object for the first VSProjectItem.
' Before running, open a VB or C# application in VS.
Dim vsPrj As VSProject = _
CType(dte.Solution.Projects.Item(1).Object, _
VSProject)
Dim vsPrjItem As VSProjectItem
vsPrjItem = CType(dte.Solution.Projects.Item(1) _
.ProjectItems.Item(1).Object, VSProjectItem)
MsgBox("Parent object for VSProjectItem: " & vsPrjItem.DTE)
End Sub
public void PrjDTE(DTE2 dte)
{
// Lists the parent object for the first VSProjectItem.
// Before running, open a VB or C# application in VS.
VSProject vsPrj = (VSProject)dte.Solution.
Projects.Item(1).Object;
VSProjectItem vsPrjItem;
vsPrjItem = (VSProjectItem)dte.Solution.
Projects.Item(1).ProjectItems.Item(1).Object;
MessageBox.Show("Parent object for VSProjectItem" + vsPrjItem.DTE);
}
.NET Framework-Sicherheit
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.
Siehe auch
Referenz
Weitere Ressourcen
Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell