Process.Parent Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém o objeto pai imediato de um Process objeto.
public:
property EnvDTE::Debugger ^ Parent { EnvDTE::Debugger ^ get(); };
public:
property EnvDTE::Debugger ^ Parent { EnvDTE::Debugger ^ get(); };
[System.Runtime.InteropServices.DispId(201)]
public EnvDTE.Debugger Parent { [System.Runtime.InteropServices.DispId(201)] get; }
[<System.Runtime.InteropServices.DispId(201)>]
[<get: System.Runtime.InteropServices.DispId(201)>]
member this.Parent : EnvDTE.Debugger
Public ReadOnly Property Parent As Debugger
Valor da propriedade
Um objeto Debugger.
- Atributos
Exemplos
O exemplo a seguir demonstra como usar a Parent propriedade.
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
Comentários
A Parent propriedade retorna o pai imediato para o Process objeto. Para obter a coleção de contenção, use a Collection propriedade.