Skip to content

Visualizer treeview

Zev Spitz edited this page Dec 30, 2019 · 9 revisions

The treeview shows the various objects that make up the expression tree:

Expression tree with a loop, a label, and a condition

The emphasis is on displaying the structure of the expression tree:

  • Only properties which return specific types which are part of the expression tree's structure are mapped to child nodes, such as Expression and CaseBlock

  • There are no child nodes for properties which return collections; instead, each element gets its own child node. For example, LambdaExpression has a Parameters property, which returns a ReadOnlyCollection<ParameterExpression>; but the tree doesn't have a child node for Parameters, only for the individual elements -- Parameter[0], Parameter[1] etc.:

    Elements of collection properties as child nodes

Node properties

Given the following node:

Node details

The following properties are shown for each node:

Description In highlighted example Applies to
Path from parent node Left - Every node
Node type MemberAccess ConstantExpression,
DefaultExpression,
closed-over variables
System.Type of expression (int) Expression and subtypes,
CallSiteBinder and subtypes
Name firstVariable ParameterExpression if it has one,
MemberExpression,
MethodCallExpression
LambdaExpression if it has one,
MemberBinding -- bound member's name
Rendered value of the expression, as described here = 5 ConstantExpression,
DefaultExpression,
closed-over variables