Ejemplo n.º 1
0
        private void AddParents(SharpNode node)
        {
            string path = node.GetParentPath();

            if (!string.IsNullOrEmpty(path))
            {
                var parent = _currentPackage.GetNode(path);
                if (parent == null)
                {
                    Add(new SharpNode()
                    {
                        Path = path, Name = SharpNode.GetNodeName(path)
                    });
                }
            }
        }
Ejemplo n.º 2
0
        public void UpdateNodeLinks()
        {
            SharpNode parent = null;

            if (IsValueNode && !IsSingleValueNode)
            {
                parent = GetNodes().Select(x => x.Parent).FirstOrDefault();
            }
            else
            {
                if (IsLeafNode)
                {
                    parent = Package.GetNode(GetRootPath());
                }

                if (parent == null)
                {
                    parent = Package.GetNode(GetParentPath(Path));
                }
            }

            Parent = parent;
            UpdateAncestors();
        }