Exemple #1
0
        InspectorTreeItem build(DiagnosticsNode node, bool inProperty)
        {
            D.assert(node != null);
            var item = new InspectorTreeItem(node, m_NextId++);

            inProperty = inProperty || node.isProperty;
            if (!inProperty && node.valueRef != null)
            {
                this.m_ValueToNode[node.valueRef] = item;
            }

            foreach (var propertyNode in node.inlineProperties)
            {
                item.AddChild(this.build(propertyNode, inProperty));
            }

            var children = node.children;

            foreach (var childNode in children)
            {
                item.AddChild(this.build(childNode, inProperty));
            }

            return(item);
        }
Exemple #2
0
        protected override void SelectionChanged(IList <int> selectedIds)
        {
            DiagnosticsNode node = null;

            if (selectedIds.Count > 0)
            {
                var id   = selectedIds[0];
                var item = this.FindItem(id, this.rootItem) as InspectorTreeItem;
                if (item != null)
                {
                    node = item.node;
                }
            }

            if (this.onNodeSelectionChanged != null)
            {
                this.onNodeSelectionChanged(node);
            }
        }
        public DiagnosticsNode getSelection(DiagnosticsNode previousSelection, WidgetTreeType treeType, bool localOnly,
                                            string groupName)
        {
            InspectorInstanceRef previousSelectionRef =
                previousSelection == null ? null : previousSelection.diagnosticRef;
            string          previousSelectionId = previousSelectionRef == null ? null : previousSelectionRef.id;
            DiagnosticsNode result = null;

            this.window.withBinding(() => {
                switch (treeType)
                {
                case WidgetTreeType.Widget:
                    result = localOnly
                            ? this.toNode(
                        this._widgetInspectorService.getSelectedSummaryWidget(previousSelectionId, groupName))
                            : this.toNode(
                        this._widgetInspectorService.getSelectedWidget(previousSelectionId, groupName));
                    break;

                case WidgetTreeType.Render:
                    result = this.toNode(
                        this._widgetInspectorService.getSelectedRenderObject(previousSelectionId, groupName));
                    break;
                }
            });


            if (result != null && result.diagnosticRef == previousSelectionRef)
            {
                return(previousSelection);
            }
            else
            {
                return(result);
            }
        }
Exemple #4
0
 void OnNodeSelectionChanged(DiagnosticsNode node)
 {
     this.m_SelectedNodeRef = node == null ? null : node.diagnosticRef;
     this.m_InspectorService.setSelection(node == null ? null : node.valueRef, this.m_GroupName);
     this.m_NeedDetailUpdate = this.m_DetailTreeView != null;
 }
Exemple #5
0
 public InspectorTreeItem(DiagnosticsNode node, int id) : base(id)
 {
     this.node = node;
 }