From 17302345ecfd05385c9940db216cf0f387406bdb Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 19 Nov 2024 00:59:24 +0100 Subject: [PATCH] Fix #3332: Re-apply filter to all descendants. --- ILSpy/TreeNodes/ILSpyTreeNode.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ILSpy/TreeNodes/ILSpyTreeNode.cs b/ILSpy/TreeNodes/ILSpyTreeNode.cs index a912aec9d2..413aedb044 100644 --- a/ILSpy/TreeNodes/ILSpyTreeNode.cs +++ b/ILSpy/TreeNodes/ILSpyTreeNode.cs @@ -29,8 +29,8 @@ using ICSharpCode.ILSpy.AssemblyTree; using ICSharpCode.ILSpy.Docking; using ICSharpCode.ILSpyX.Abstractions; -using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; using ICSharpCode.ILSpyX.TreeView; +using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; namespace ICSharpCode.ILSpy.TreeNodes { @@ -130,9 +130,6 @@ void ApplyFilterToChild(ILSpyTreeNode child) child.IsHidden = false; break; case FilterResult.Recurse: - child.EnsureChildrenFiltered(); - child.IsHidden = child.Children.All(c => c.IsHidden); - break; case FilterResult.MatchAndRecurse: child.EnsureChildrenFiltered(); child.IsHidden = child.Children.All(c => c.IsHidden); @@ -161,16 +158,12 @@ protected virtual void Settings_Changed(object sender, PropertyChangedEventArgs } } - internal void EnsureChildrenFiltered() { EnsureLazyChildren(); - if (childrenNeedFiltering) - { - childrenNeedFiltering = false; - foreach (ILSpyTreeNode node in this.Children.OfType()) - ApplyFilterToChild(node); - } + childrenNeedFiltering = false; + foreach (ILSpyTreeNode node in this.Children.OfType()) + ApplyFilterToChild(node); } protected string GetSuffixString(IMember member) => GetSuffixString(member.MetadataToken);