Пример #1
0
 private void ExpandMembersOfNode(TLNode node)
 {
     if (node is MemberNode)
     {
         MemberNode n = (MemberNode)node;
         if (n.Nodes.Count == 0)
         {
             n.ExpandMembers(btnShowControls.Checked, btnShowFields.Checked, btnShowProperties.Checked);
         }
     }
     else if (node is IEnumerableNode)
     {
         IEnumerableNode n = (IEnumerableNode)node;
         if (n.Nodes.Count == 0)
         {
             n.ExpandMembers();
         }
     }
 }
Пример #2
0
        public LocalsWindow(string thisName, object obj)
        {
            this.thisObject = obj;

            InitializeComponent();

            if (!string.IsNullOrEmpty(thisName))
            {
                Text = "Locals & Watches - " + thisName;
            }

            tree.Columns.Add(new TreeListColumn("Name", "Name")
            {
                AutoSize = true
            });

            var valueCol = new TreeListColumn("Value", "Value")
            {
                AutoSize = true
            };

            valueCol.CellFormatConditions = new RunTimeDebuggers.Controls.TreeList.ConditionalFormatting[] {
                new RunTimeDebuggers.Controls.TreeList.ConditionalFormatting(n => n is ILocalsNode && ((ILocalsNode)n).Changed,
                                                                             new RunTimeDebuggers.Controls.TreeList.TextFormatting(valueCol.CellFormat)
                {
                    ForeColor = Color.Red
                })
            };

            tree.Columns.Add(valueCol);
            tree.Columns.Add(new TreeListColumn("Type", "Type")
            {
                AutoSize = true
            });

            FillImageListForMemberIcons(imgs);

            tree.Images = imgs;

            if (obj != null)
            {
                rootNode = new MemberNode(thisName + " (this)", obj, obj == null ? null : obj.GetType().ToSignatureString())
                {
                    Object     = obj,
                    ObjectType = obj.GetType(),
                    Member     = null
                };
                rootNode.HasChildren = true;
                rootNode.ImageId     = (int)IconEnum.PublicField;
                rootNode.ExpandMembers(btnShowControls.Checked, btnShowFields.Checked, btnShowProperties.Checked);
                rootNode.Expand();
                tree.Nodes.Add(rootNode);
            }

            tree.RowOptions.ShowHeader = false;

            tree.NotifyBeforeExpand += new TreeListView.NotifyBeforeExpandHandler(tree_NotifyBeforeExpand);

            exprBox = new ExpressionBox(obj);
            exprBox.ExpressionEvaluated += new ExpressionBox.ExpressionEvaluatedHandler(exprBox_ExpressionEvaluated);
            exprBox.Dock = DockStyle.Fill;
            pnl.Controls.Add(exprBox);

            FillControlTree();
        }