Proprietà Language.Name

Ottiene il nome dell'oggetto.

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

Sintassi

'Dichiarazione
ReadOnly Default Property Name As String
    Get
string this { get; }
property String^ default {
    String^ get ();
}
abstract Name : string
function get Name () : String

Valore proprietà

Tipo: System.String
Stringa che rappresenta il nome dell'oggetto Language.

Esempi

Nell'esempio riportato di seguito viene illustrato come utilizzare la proprietà Name.

Per verificare la proprietà:

  1. Impostare un punto di interruzione nell'applicazione di destinazione.

  2. Eseguire l'applicazione di destinazione in modalità di debug.

  3. Quando l'applicazione si interrompe in corrispondenza del punto di interruzione, eseguire il componente aggiuntivo.

Public static void Name(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("Name Property Test");
    owp.Activate();

    EnvDTE.Language language = dte.Debugger.Languages.Item(1);
    owp.OutputString("Number of items in the language collection is " + 
                     language.Collection.Count + ": ");
    foreach(EnvDTE.Language lang in language.Collection)
        owp.OutputString(lang.Name + "  ");
    owp.OutputString("\nEdition of the environment: " + language.DTE.Edition);
    owp.OutputString("\nThe name of the current program: " + 
                     language.Parent.CurrentProgram.Name);
}
Shared Sub Name(ByRef dte As EnvDTE.DTE)
    Dim language As EnvDTE.Language = dte.Debugger.Languages.Item(1)
    Dim str As String = vbCrLf
    str = "There are " + language.Collection.Count.ToString()
    str += " items in the language collection: "
    For Each lang As EnvDTE.Language In language.Collection
        str += lang.Name + "  "
    Next
    str += vbCrLf + vbCrLf + "Edition of the environment: " + _
           language.DTE.Edition
    str += vbCrLf + vbCrLf + "The name of the current program: " + _
           language.Parent.CurrentProgram.Name
    MessageBox.Show(str, "Language Test - Name Property")
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Language Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione