void Insert(MacObjectValueNode parent, int index, ObjectValueNode node)
        {
            var value = new MacObjectValueNode(parent, node);

            mapping[node] = value;

            if (index < parent.Children.Count)
            {
                parent.Children.Insert(index, value);
            }
            else
            {
                parent.Children.Add(value);
            }

            if (treeView.AllowExpanding)
            {
                foreach (var child in node.Children)
                {
                    Add(value, child);
                }

                if (node.HasChildren && !node.ChildrenLoaded)
                {
                    Add(value, new LoadingObjectValueNode(node));
                }
            }
        }
Exemple #2
0
 public MacObjectValueNode(MacObjectValueNode parent, ObjectValueNode target)
 {
     OptimalValueWidth = -1.0f;
     OptimalNameWidth  = -1.0f;
     OptimalValueFont  = null;
     OptimalNameFont   = null;
     OptimalXOffset    = -1.0f;
     Parent            = parent;
     Target            = target;
 }
        void Remove(MacObjectValueNode node)
        {
            foreach (var child in node.Children)
            {
                Remove(child);
            }

            mapping.Remove(node.Target);
            node.Children.Clear();
            node.Dispose();
        }
        void Remove(MacObjectValueNode node, List <MacObjectValueNode> removed)
        {
            foreach (var child in node.Children)
            {
                Remove(child, removed);
            }

            mapping.Remove(node.Target);
            node.Children.Clear();
            removed.Add(node);
        }
        void Insert(MacObjectValueNode parent, int index, ObjectValueNode node)
        {
            var value = new MacObjectValueNode(parent, node);

            mapping[node] = value;

            parent.Children.Insert(index, value);

            foreach (var child in node.Children)
            {
                Add(value, child);
            }

            if (node.HasChildren && !node.ChildrenLoaded)
            {
                Add(value, new LoadingObjectValueNode(node));
            }
        }
        public MacObjectValueTreeViewDataSource(MacObjectValueTreeView treeView, ObjectValueNode root, bool allowWatchExpressions)
        {
            AllowWatchExpressions = allowWatchExpressions;
            this.treeView         = treeView;

            Root = new MacObjectValueNode(null, root);
            mapping.Add(root, Root);

            foreach (var child in root.Children)
            {
                Add(Root, child);
            }

            if (allowWatchExpressions)
            {
                Add(Root, new AddNewExpressionObjectValueNode());
            }
        }
        void Add(MacObjectValueNode parent, ObjectValueNode node)
        {
            var value = new MacObjectValueNode(parent, node);

            mapping[node] = value;

            parent.Children.Add(value);

            if (treeView.AllowExpanding)
            {
                foreach (var child in node.Children)
                {
                    Add(value, child);
                }

                if (node.HasChildren && !node.ChildrenLoaded)
                {
                    Add(value, new LoadingObjectValueNode(node));
                }
            }
        }
 public bool TryGetValue(ObjectValueNode node, out MacObjectValueNode value)
 {
     return(mapping.TryGetValue(node, out value));
 }
Exemple #9
0
 public MacObjectValueNode(MacObjectValueNode parent, ObjectValueNode target)
 {
     Parent = parent;
     Target = target;
 }