Compartir a través de


Process.Programs (Propiedad)

Obtiene la colección de programas que está administrando este proceso.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
ReadOnly Property Programs As Programs
    Get
Programs Programs { get; }
property Programs^ Programs {
    Programs^ get ();
}
abstract Programs : Programs
function get Programs () : Programs

Valor de propiedad

Tipo: EnvDTE.Programs
Una colección de Programs.

Ejemplos

En el siguiente ejemplo se muestra cómo utilizar la propiedad Programs.

Para probar esta propiedad

  1. Establezca un punto de interrupción en su aplicación de destino.

  2. Ejecute la aplicación de destino en el modo de depuración.

  3. Cuando la aplicación se detenga en el punto de interrupción, ejecute el complemento.

public static void Programs(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("Programs Property Test");
    owp.Activate();
    owp.OutputString("\nEdition of the environment: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).DTE.Edition);
    owp.OutputString("\nThe name of the current program: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).Name);
    owp.OutputString("\nThe name of the current program: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).Parent.CurrentProgram.Name);
    owp.OutputString("\nProcess ID: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).ProcessID);
    EnvDTE.Programs programs = 
                        dte.Debugger.DebuggedProcesses.Item(1).Programs;
    owp.OutputString("\nThe name of the current program: " + 
                        programs.Item(1).Name);
}
Shared Sub Programs(ByRef dte As EnvDTE.DTE)
    Dim str As String
    Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses
    str = "Edition of the environment: " + processes.Item(1).DTE.Edition
    str += vbCrLf + "The name of the current program: " + _
           processes.Item(1).Name
    str += vbCrLf + "The name of the current program: " + _
           processes.Item(1).Parent.CurrentProgram.Name
    str += vbCrLf + "Process ID: " + processes.Item(1).ProcessID.ToString()
    str += vbCrLf + "The name of the current program: " + _
           processes.Item(1).Programs.Item(1).Name
    MessageBox.Show(str, "Programs Property Test")
End Sub

Seguridad de .NET Framework

Vea también

Referencia

Process Interfaz

EnvDTE (Espacio de nombres)

Program