Proprietà Languages.DTE
Ottiene l'oggetto estensibilità di primo livello.
Spazio dei nomi: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Sintassi
'Dichiarazione
ReadOnly Property DTE As DTE
DTE DTE { get; }
property DTE^ DTE {
DTE^ get ();
}
abstract DTE : DTE with get
function get DTE () : DTE
Valore proprietà
Tipo: EnvDTE.DTE
Oggetto DTE.
Note
In Visual Studio, DTE è la radice del modello di automazione che, in altri modelli a oggetti, viene spesso chiamato "Applicazione".
Esempi
Nell'esempio seguente viene illustrato l'utilizzare della proprietà DTE.
Per verificare la proprietà:
Impostare un punto di interruzione nell'applicazione di destinazione.
Eseguire l'applicazione di destinazione in modalità debug.
Quando l'applicazione si interrompe al punto di interruzione, eseguire il componente aggiuntivo.
public static void DTE(DTE dte)
{
// Setup debug Output window.
Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
w.Visible = true;
OutputWindow ow = (OutputWindow)w.Object;
OutputWindowPane owp = ow.OutputWindowPanes.Add("DTE Property Test");
owp.Activate();
EnvDTE.Languages languages = dte.Debugger.Languages;
owp.OutputString("\nEdition of the environment: " + languages.DTE.Edition);
owp.OutputString("\nThird language in the language collection: " +
languages.Item(3).Name);
owp.OutputString("\nThe name of the current program: " +
languages.Parent.CurrentProgram.Name);
}
Shared Sub DTE(ByRef dte As EnvDTE.DTE)
Dim languages As EnvDTE.Languages = dte.Debugger.Languages
Dim str As String = vbCrLf
str = "Edition of the environment: " + languages.DTE.Edition
str += vbCrLf + vbCrLf + "Third language in the language collection: "
str += languages.Item(3).Name
str += vbCrLf + vbCrLf + "The name of the current program: " + _
languages.Parent.CurrentProgram.Name
MessageBox.Show(str, "Language Test - DTE Property")
End Sub
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per altre informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
Altre risorse
Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione