Aracılığıyla paylaş


Debugger.CurrentProgram Özellik

Ayarlar veya etkin programdan alır.

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

Sözdizimi

'Bildirim
Property CurrentProgram As Program
    Get
    Set
Program CurrentProgram { get; set; }
property Program^ CurrentProgram {
    Program^ get ();
    void set (Program^ value);
}
abstract CurrentProgram : Program with get, set
function get CurrentProgram () : Program
function set CurrentProgram (value : Program)

Özellik Değeri

Tür: EnvDTE.Program
Active Program.

Açıklamalar

CurrentProgramayarlar veya döndürür etkin Program. Etkin program hata ayıklayıcı tarafından görüntülenen verileri tanımlayan bir programdır. 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 CurrentProgram özelliği.

Bu özellik test etmek için:

  1. Hedef uygulama açın. Eklentiyi çalıştırın. Hiçbir program 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. Program ayıklanacak.

public static void CurrentProgram(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 Program Test");
    owp.Activate();

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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Debugger Arabirim

EnvDTE Ad Alanı

Debugger