Expression.Parent Property
Gets the immediate parent object of an Expression object.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
ReadOnly Property Parent As Debugger
'Usage
Dim instance As Expression
Dim value As Debugger
value = instance.Parent
Debugger Parent { get; }
property Debugger^ Parent {
Debugger^ get ();
}
function get Parent () : Debugger
Property Value
Type: EnvDTE.Debugger
A Debugger object.
Remarks
The Parent property returns the immediate parent to the Expression object. If you want to get the containing collection, then use the Collection property.
Examples
The following example demonstrates how to use the Parent property.
To test this property:
Set a breakpoint in your target application.
Run the target application in the debug mode.
When the application stops at the breakpoint, run the add-in.
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();
EnvDTE.Expression 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 EnvDTE.Expression = dte.Debugger.GetExpression("tempC", True, 1)
MessageBox.Show("The name of the current program: " + _
exp.Parent.CurrentProgram.Name, _
"Expression Test - Parent Property")
End Sub
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Other Resources
How to: Compile and Run the Automation Object Model Code Examples