Condividi tramite


Interfaccia DTE

Aggiornamento: novembre 2007

L'oggetto di primo livello nel modello di oggetto di automazione di Visual Studio. Utilizzare questo oggetto per la funzionalità e fare riferimento a _DTE per la documentazione dell'oggetto.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

<GuidAttribute("04A72314-32E9-48E2-9B87-A63603454F3E")> _
Public Interface DTE _
    Implements _DTE

Dim instance As DTE
[GuidAttribute("04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface DTE : _DTE
[GuidAttribute(L"04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface class DTE : _DTE
public interface DTE extends _DTE

Note

L'oggetto DTE viene fornito dal metodo OnConnection che viene implementato quando si crea un componente aggiuntivo. L'oggetto DTE è l'oggetto Application in Visual Basic.

Per accedere alle proprietà specifiche di un progetto, ad esempio VBProjects o CSharpProjects, utilizzare la sintassi DTE.GetObject("VBProjects").

Per informazioni su come fare riferimento allo spazio dei nomi EnvDTE e all'oggetto DTE, vedere Riferimenti agli assembly di automazione e all'oggetto DTE2.

Esempi

Sub DTEExample()
    Dim objTextDoc As TextDocument
    Dim objEP As EditPoint
    
    ' Create a new text document.
    DTE.ItemOperations.NewFile("General\Text File")
    ' Get a handle to the new document.
    Set objTextDoc = DTE.ActiveDocument.Object("TextDocument")
    Set objEP = objTextDoc.StartPoint.CreateEditPoint
    ' Create an EditPoint and add some text.
    objEP.Insert "A test sentence."
End Sub

Vedere anche

Riferimenti

Membri DTE

Spazio dei nomi EnvDTE