Example #1
0
        public List <DiagnosticsNode> getProperties(InspectorInstanceRef inspectorInstanceRef, string groupName)
        {
            var list = this.window.withBindingFunc(() =>
                                                   this._widgetInspectorService.getProperties(inspectorInstanceRef.id, groupName));

            return(list.Select(json => this.toNode(json, isProperty: true)).ToList());
        }
Example #2
0
        public InspectorTreeItem getTreeItemByValueRef(InspectorInstanceRef instanceRef, TreeViewItem from = null)
        {
            InspectorTreeItem item;

            this.m_ValueToNode.TryGetValue(instanceRef, out item);
            return(item);
        }
Example #3
0
        void updateSelection()
        {
            if (!this.m_NeedSelectionUpdate)
            {
                return;
            }

            this.m_NeedSelectionUpdate = false;
            var diagnosticsNode = this.m_InspectorService.getSelection(this.m_TreeView.selectedNode, this.treeType,
                                                                       true, this.m_GroupName);

            this.m_SelectedNodeRef = diagnosticsNode == null ? null : diagnosticsNode.diagnosticRef;

            if (diagnosticsNode != null)
            {
                var item = this.m_TreeView.getTreeItemByValueRef(diagnosticsNode.valueRef);
                if (item == null)
                {
                    this.LoadTree();
                    item = this.m_TreeView.getTreeItemByValueRef(diagnosticsNode.valueRef);
                }

                this.m_TreeView.CollapseAll();
                if (item != null)
                {
                    this.m_TreeView.SetSelection(new List <int> {
                        item.id
                    }, TreeViewSelectionOptions.RevealAndFrame);
                }
                else
                {
                    this.m_TreeView.SetSelection(new List <int>());
                }

                this.m_TreeView.Repaint();
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
 public bool setSelection(InspectorInstanceRef inspectorInstanceRef, string groupName)
 {
     return(this.window.withBindingFunc(() =>
                                        this._widgetInspectorService.setSelectionById(inspectorInstanceRef.id, groupName)));
 }
Example #6
0
 public DiagnosticsNode getDetailsSubtree(InspectorInstanceRef instanceRef, string groupName)
 {
     return(this.toNode(this.window.withBindingFunc(() =>
                                                    this._widgetInspectorService.getDetailsSubtree(instanceRef.id, groupName))));
 }
Example #7
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;
 }