示例#1
0
        internal bool OnBeforeMultiSelect(TreeNodeAdv node)
        {
            var args = new TreeViewAdvCancelEventArgs(node)
            {
                Cancel = false
            };

            BeforeMultiSelect?.Invoke(this, args);

            return(!args.Cancel);
        }
示例#2
0
        bool OnBeforeSelectedNodesChange(ImmutableHashSet <TreeNode> nodes)
        {
            IReadOnlyCollection <TreeNode> orderedNodes;
            var primary = GetPrimarySelectedNode(nodes);

            if (primary != null)
            {
                orderedNodes = Enumerable.Union(new[] { primary }, nodes.Remove(primary)).ToArray();
            }
            else
            {
                orderedNodes = nodes;
            }
            var evt = new TreeViewMultiNodeCancelEventArgs(orderedNodes, false);

            BeforeMultiSelect?.Invoke(this, evt);
            return(!evt.Cancel);
        }