Sdílet prostřednictvím


Expression2.Parent Property

Definition

Gets the immediate parent object of an Expression2 object.

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

Property Value

A Debugger object.

Implements

Attributes

Examples

The following example demonstrates how to use the Parent property.

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();  

    EnvDTE100.Expression2 exp = dte.Debugger.GetExpression("tempC", true, 1);  
    owp.OutputString("The name of the current program: " + exp.Parent.CurrentProgram.Name);  
}  
Shared Sub Parent(ByRef dte As EnvDTE.DTE)  
    Dim exp As EnvDTE100.Expression2 = dte.Debugger.GetExpression("tempC", True, 1)  
    MessageBox.Show("The name of the current program: " + _  
                    exp.Parent.CurrentProgram.Name, _  
                    "Expression Test - Parent Property")  
End Sub  

Remarks

The Parent property returns the immediate parent to the Expression2 object. If you want to get the containing collection, then use the Collection property.

Applies to