@@ -144,8 +144,7 @@ public void ScrollToSelected(NodeBase target)
144144
145145 private bool GetNodePosition ( NodeBase target , NodeBase parent , ref float pos , float itemHeight )
146146 {
147- bool HasText = parent . Header != null &&
148- parent . Header . IndexOf ( _searchText , StringComparison . OrdinalIgnoreCase ) >= 0 ;
147+ bool HasText = parent . IsNameMatch ( _searchText ) ;
149148
150149 //Search is active and node is found but is not in results so skip scrolling
151150 if ( isSearch && parent == target && ! HasText )
@@ -303,8 +302,7 @@ private void SetupNodes(NodeBase node)
303302
304303 private void CalculateCount ( NodeBase node , ref int counter )
305304 {
306- bool HasText = node . Header != null &&
307- node . Header . IndexOf ( _searchText , StringComparison . OrdinalIgnoreCase ) >= 0 ;
305+ bool HasText = node . IsNameMatch ( _searchText ) ;
308306
309307 if ( isSearch && HasText || ! isSearch )
310308 {
@@ -328,8 +326,7 @@ public void DeselectAll()
328326
329327 public void DrawNode ( NodeBase node , float itemHeight , int level = 0 )
330328 {
331- bool HasText = node . Header != null &&
332- node . Header . IndexOf ( _searchText , StringComparison . OrdinalIgnoreCase ) >= 0 ;
329+ bool HasText = node . IsNameMatch ( _searchText ) ;
333330
334331 char icon = IconManager . FOLDER_ICON ;
335332 if ( node . Tag is STGenericMesh )
@@ -818,14 +815,7 @@ private bool SelectNodeRange(NodeBase node, NodeBase selectedNode1, NodeBase sel
818815
819816 private List < NodeBase > GetSearchableNodes ( List < NodeBase > nodes )
820817 {
821- List < NodeBase > nodeList = new List < NodeBase > ( ) ;
822- foreach ( var node in nodes )
823- {
824- bool hasText = node . Header != null && node . Header . IndexOf ( _searchText , StringComparison . OrdinalIgnoreCase ) >= 0 ;
825- if ( hasText )
826- nodeList . Add ( node ) ;
827- }
828- return nodeList ;
818+ return nodes . Where ( n => n . IsNameMatch ( _searchText ) ) . ToList ( ) ;
829819 }
830820
831821 private void LoadTextureIcon ( NodeBase node )
0 commit comments