|
|
|
@ -151,11 +151,13 @@ namespace ICSharpCode.TreeView
@@ -151,11 +151,13 @@ namespace ICSharpCode.TreeView
|
|
|
|
|
if (selectedOldItems != null) { |
|
|
|
|
var list = SelectedItems.Cast<SharpTreeNode>().Except(selectedOldItems).ToList(); |
|
|
|
|
SetSelectedItems(list); |
|
|
|
|
if (SelectedItem == null) { |
|
|
|
|
// if we removed all selected nodes, then move the focus to the node
|
|
|
|
|
// preceding the first of the old selected nodes
|
|
|
|
|
SelectedIndex = Math.Max(0, e.OldStartingIndex - 1); |
|
|
|
|
FocusNode((SharpTreeNode)SelectedItem); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// reset the focus to the previous node
|
|
|
|
|
SelectedIndex = Math.Max(0, e.OldStartingIndex - 1); |
|
|
|
|
if (SelectedItem != null) |
|
|
|
|
FocusNode((SharpTreeNode)SelectedItem); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|