Partager via


VSProjectItem.DTE, propriété

Retourne l'objet d'extensibilité de niveau supérieur.

Espace de noms :  VSLangProj
Assembly :  VSLangProj (dans VSLangProj.dll)

Syntaxe

'Déclaration
ReadOnly Property DTE As DTE
    Get
DTE DTE { get; }
property DTE^ DTE {
    DTE^ get ();
}
abstract DTE : DTE
function get DTE () : DTE

Valeur de propriété

Type : EnvDTE.DTE
Retourne un objet DTE.

Notes

Dans Visual Studio, l'objet DTE est à la base du modèle Automation que les autres modèles objet appellent souvent "Application".

Exemples

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);
}

Sécurité .NET Framework

Voir aussi

Référence

VSProjectItem Interface

VSLangProj, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation