Fixed case sensitivity when searching for nodes

This commit is contained in:
David Sparer
2016-09-14 12:23:42 -06:00
parent a992b41e26
commit 764eb764ce

View File

@@ -19,13 +19,15 @@ namespace mRemoteNG.Tree
internal IEnumerable<ConnectionInfo> SearchByName(string searchText)
{
if (searchText == "")
ResetMatches();
else
ResetMatches();
if (searchText == "") return Matches;
var nodes = (List<ConnectionInfo>)_connectionTreeModel.GetRecursiveChildList();
foreach (var node in nodes)
{
Matches = (List<ConnectionInfo>)_connectionTreeModel.GetRecursiveChildList().Where(node => node.Name.Contains(searchText));
_currentMatch = Matches.First();
if (node.Name.ToLowerInvariant().Contains(searchText.ToLowerInvariant()))
Matches.Add(node);
}
_currentMatch = Matches.First();
return Matches;
}