Ejemplo n.º 1
0
        IEnumerable <NodeInfo> EnumViewTree(NodesCollectionInfo rootCollection)
        {
            foreach (NodeInfo node in view.EnumCollection(rootCollection))
            {
                yield return(node);

                foreach (NodeInfo child in EnumViewTree(node.ChildrenNodesCollection))
                {
                    yield return(child);
                }
            }
        }
Ejemplo n.º 2
0
        NodeInfo CreateViewNode(IView view, NodesCollectionInfo collectionToAddViewNode, IInspectedObject modelNode, int level, List <NodeInfo> nodesToCollapse)
        {
            string nodeText = modelNode.DisplayName;

            if (modelNode.Comment != "")
            {
                nodeText += " (" + modelNode.Comment + ")";
            }

            bool createCollapsed    = false;
            bool createLazilyLoaded = false;

            if (level < 5)
            {
                if (OnNodeCreated != null)
                {
                    var args = new NodeCreatedEventArgs()
                    {
                        NodeObject = VisualizerNode.FromObject(modelNode)
                    };
                    OnNodeCreated(this, args);
                    createCollapsed    = args.CreateCollapsed.GetValueOrDefault(createCollapsed);
                    createLazilyLoaded = args.CreateLazilyLoaded.GetValueOrDefault(createLazilyLoaded);
                }
                if (createLazilyLoaded && !view.TreeSupportsLoadingOnExpansion)
                {
                    createLazilyLoaded = false;
                }
            }

            var viewNode = view.CreateNode(nodeText, modelNode, collectionToAddViewNode);

            if (createLazilyLoaded)
            {
                view.CreateNode(lazyLoadTag, lazyLoadTag, viewNode.ChildrenNodesCollection);
            }
            else
            {
                foreach (var child in modelNode.Children)
                {
                    CreateViewNode(view, viewNode.ChildrenNodesCollection, child, level + 1, nodesToCollapse);
                }
            }
            if (createCollapsed)
            {
                nodesToCollapse.Add(viewNode);
            }
            return(viewNode);
        }
Ejemplo n.º 3
0
 private void UpdateLiveObjectsColoring(NodesCollectionInfo collection)
 {
     foreach (NodeInfo node in EnumViewTree(collection))
     {
         var obj = GetInspectedObject(node);
         if (obj == null)
         {
             continue;
         }
         var liveStatus = obj.GetLiveStatus(GetFocusedMessageEqualRange(obj));
         var coloring   = GetLiveStatusColoring(liveStatus);
         if (node.Coloring != coloring)
         {
             view.SetNodeColoring(node, coloring);
         }
     }
 }