示例#1
0
文件: TreeNode.cs 项目: Soju06/NUMC
        private void Nodes_ItemsAdded(object sender, ObservableListModified <TreeNode> e)
        {
            foreach (var node in e.Items)
            {
                node.ParentNode = this;
                node.ParentTree = ParentTree;
            }

            if (ParentTree != null && ParentTree.TreeViewNodeSorter != null)
            {
                Nodes.Sort(ParentTree.TreeViewNodeSorter);
            }

            ItemsAdded?.Invoke(this, e);
        }
示例#2
0
文件: TreeView.cs 项目: Soju06/NUMC
        private void Nodes_ItemsAdded(object sender, ObservableListModified <TreeNode> e)
        {
            foreach (var node in e.Items)
            {
                node.ParentTree = this;
                node.IsRoot     = true;

                HookNodeEvents(node);
            }

            if (TreeViewNodeSorter != null)
            {
                Nodes.Sort(TreeViewNodeSorter);
            }

            UpdateNodes();
        }