Esempio n. 1
0
        public bool AddChild(KeyTreeNode <TKey, TValue> node)
        {
            if (node.Parent != null || _children.ContainsKey(node.Key))
            {
                return(false);
            }

            node.Parent = this;
            _children.Add(node.Key, node);
            return(true);
        }
Esempio n. 2
0
        public bool AddChild(TKey key, TValue value)
        {
            if (_children.ContainsKey(key))
            {
                return(false);
            }

            var node = new KeyTreeNode <TKey, TValue>(key, value)
            {
                Parent = this
            };

            _children.Add(key, node);
            return(true);
        }