Share via


Proprietà Debugger.CurrentProcess

Imposta o ottiene il processo attivo.

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

Sintassi

'Dichiarazione
Property CurrentProcess As Process
Process CurrentProcess { get; set; }
property Process^ CurrentProcess {
    Process^ get ();
    void set (Process^ value);
}
abstract CurrentProcess : Process with get, set
function get CurrentProcess () : Process
function set CurrentProcess (value : Process)

Valore proprietà

Tipo: EnvDTE.Process
In Process oggetto.

Note

CurrentProcess imposta o restituisce attivo Process.Il processo attivo è il processo che definisce i dati visualizzata dal debugger.Sebbene il debugger supporta il debug più di un processo alla volta, solo uno di processo può essere attivo in un determinato momento.vedere Debug di più processi per ulteriori informazioni.

Esempi

Nell'esempio seguente viene illustrato come utilizzare CurrentProcess proprietà.

Per verificare questa proprietà:

  1. aprire l'applicazione di destinazione.eseguire il componente aggiuntivo.Alcun processo sottoposto a debug.

  2. Impostare un punto di interruzione nell'applicazione di destinazione.Eseguire l'applicazione in modalità di debug.

  3. Quando il programma si interrompe sul punto di interruzione, eseguire il componente aggiuntivo.Il processo sottoposto a debug.

public static void CurrentProcess(DTE dte)
{
    // Setup the 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("Current Process Test");
    owp.Activate();

    owp.OutputString("Current Process Info: ");
    EnvDTE.Process process = dte.Debugger.CurrentProcess;
    if(process == null)
        owp.OutputString("No process is being debugged");
    else
        owp.OutputString("Process ID = " + process.ProcessID + 
                         "  Process Name = " + process.Name);
}
Shared Sub CurrentProcess(ByRef dte As EnvDTE.DTE)
     Dim process As EnvDTE.Process = dte.Debugger.CurrentProcess
     If process Is Nothing Then
         MessageBox.Show("No process is being debugged", "Debugger Test")
     Else
         MessageBox.Show("Process ID = " + process.ProcessID.ToString() + _
                         "  Process Name = " + process.Name, "Debugger Test")
     End If
 End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Debugger Interfaccia

Spazio dei nomi EnvDTE