internal bool OnBeforeMultiSelect(TreeNodeAdv node) { var args = new TreeViewAdvCancelEventArgs(node) { Cancel = false }; BeforeMultiSelect?.Invoke(this, args); return(!args.Cancel); }
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); }