Browse Source

display a message if navigation is not possible; fixes #237

pull/252/head
Siegfried Pammer 15 years ago
parent
commit
fe7fdec28b
  1. 13
      ILSpy/MainWindow.xaml.cs

13
ILSpy/MainWindow.xaml.cs

@ -382,9 +382,16 @@ namespace ICSharpCode.ILSpy @@ -382,9 +382,16 @@ namespace ICSharpCode.ILSpy
internal void SelectNode(SharpTreeNode obj)
{
if (obj != null) {
// Set both the selection and focus to ensure that keyboard navigation works as expected.
treeView.FocusNode(obj);
treeView.SelectedItem = obj;
if (!obj.AncestorsAndSelf().Any(node => node.IsHidden)) {
// Set both the selection and focus to ensure that keyboard navigation works as expected.
treeView.FocusNode(obj);
treeView.SelectedItem = obj;
} else {
MessageBox.Show("Navigation failed because the target is hidden or a compiler-generated class.\n" +
"Please disable all filters that might hide the item (i.e. activate " +
"\"View > Show internal types and members\") and try again.",
"ILSpy", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
}

Loading…
Cancel
Save