Aracılığıyla paylaş


Debugger.CurrentProcess Özellik

Ayarlar veya etkin işlem alır.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

'Bildirim
Property CurrentProcess As Process
    Get
    Set
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)

Özellik Değeri

Tür: EnvDTE.Process
Process nesnesi

Açıklamalar

CurrentProcessayarlar veya döndürür etkin Process. Etkin işlem hata ayıklayıcı tarafından görüntülenen verileri tanımlayan işlemidir. Aynı anda birden fazla işlem hata ayıklama hata ayıklayıcı desteklemesine rağmen belirli bir anda yalnızca bir işlem etkin olabilir. Daha fazla bilgi için bkz. Birden çok İşlemler hata ayıklama.

Örnekler

Aşağıdaki örnek, nasıl kullanılacağını gösterir CurrentProcess özelliği.

Bu özellik test etmek için:

  1. Hedef uygulama açın. Eklentiyi çalıştırın. Hiçbir işlem ayıklanacak.

  2. Bir kesme noktası hedef uygulamada ayarlayın. Uygulama hata ayıklama modunda çalıştırın.

  3. Program bir kesme noktasına durduğunda, eklentiyi çalıştırın. İşlem ayıklanacak.

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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Debugger Arabirim

EnvDTE Ad Alanı