Expression.Parent Property


Gets the immediate parent object of an Expression object.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Debugger Parent { get; }

Property Value

Type: EnvDTE.Debugger

A Debugger object.

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

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

    EnvDTE.Expression exp = dte.Debugger.GetExpression("tempC", true, 1);
    owp.OutputString("The name of the current program: " + exp.Parent.CurrentProgram.Name);
Return to top