Пример #1
0
        private void ForEach(RedDotNode node, Action <RedDotNode> nodeAction = null)
        {
            if (node.Children.Count <= 0)
            {
                return;
            }

            foreach (var child in Children)
            {
                nodeAction?.Invoke(child);
                ForEach(child, nodeAction);
            }
        }
Пример #2
0
        public RedDotNode AddChild(RedDotRef item)
        {
            var child = Children.Find(c => c.Item == item);

            if (child != null)
            {
                return(child);
            }

            var nodeItem = new RedDotNode(item)
            {
                Root   = Root,
                Parent = this
            };

            Children.Add(nodeItem);
            return(nodeItem);
        }