次の方法で共有


Debugger.CurrentProgram Property

Definition

Sets or gets the active program.

public:
 property EnvDTE::Program ^ CurrentProgram { EnvDTE::Program ^ get(); void set(EnvDTE::Program ^ value); };
public:
 property EnvDTE::Program ^ CurrentProgram { EnvDTE::Program ^ get(); void set(EnvDTE::Program ^ value); };
[System.Runtime.InteropServices.DispId(104)]
public EnvDTE.Program CurrentProgram { [System.Runtime.InteropServices.DispId(104)] get; [System.Runtime.InteropServices.DispId(104)] set; }
[<System.Runtime.InteropServices.DispId(104)>]
[<get: System.Runtime.InteropServices.DispId(104)>]
[<set: System.Runtime.InteropServices.DispId(104)>]
member this.CurrentProgram : EnvDTE.Program with get, set
Public Property CurrentProgram As Program

Property Value

The active Program.

Attributes

Examples

The following example demonstrates how to use the CurrentProgram property.

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  

Remarks

CurrentProgram sets or returns the active Program. The active program is the program that defines the data displayed by the debugger. Although the debugger supports debugging more than one process at a time, only one process can be active at any given time. See Debugging Multiple Programs for more information.

Applies to