Sdílet prostřednictvím


Process.Parent – vlastnost

Bezprostřední nadřízený objekt dostane Process objektu.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

'Deklarace
ReadOnly Property Parent As Debugger
    Get
Debugger Parent { get; }
property Debugger^ Parent {
    Debugger^ get ();
}
abstract Parent : Debugger
function get Parent () : Debugger

Hodnota vlastnosti

Typ: EnvDTE.Debugger
A Debugger objektu.

Poznámky

Parent Vrátí vlastnost bezprostředně nadřízeném Process objektu. Získejte kolekci obsahující použijte Collection vlastnost.

Příklady

Následující příklad demonstruje použití Parent vlastnost.

Tato vlastnost test

  1. Nastavte zarážky v cílové aplikaci.

  2. Cílová aplikace spouštět v režimu ladění.

  3. Doplněk spusťte po ukončení aplikace na bod přerušení.

public static void Parent(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("Parent 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 Parent(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, "Parent Property Test")
End Sub

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

Process Rozhraní

EnvDTE – obor názvů

Další zdroje

How to: Compile and Run the Automation Object Model Code Examples