Skip to content

Commit 105ca12

Browse files
committed
Search by Host (Hostname)
1 parent 7774170 commit 105ca12

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎Source/NETworkManager/ViewModels/Applications/PingHostViewModel.cs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
using NETworkManager.Controls;
33
using Dragablz;
44
using System.Windows.Input;
5-
using System;
6-
using System.Linq;
75
using NETworkManager.Views.Applications;
86
using System.Windows;
97

‎Source/NETworkManager/ViewModels/Applications/RemoteDesktopViewModel.cs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ public RemoteDesktopViewModel(IDialogCoordinator instance)
144144

145145
string search = Search.Trim();
146146

147+
// Search by: Tag
147148
if (search.StartsWith(tagIdentifier, StringComparison.OrdinalIgnoreCase))
148149
{
149150
if (string.IsNullOrEmpty(info.Tags))
150151
return false;
151152
else
152153
return info.Tags.Replace(" ", "").Split(';').Any(str => search.Substring(tagIdentifier.Length, search.Length - tagIdentifier.Length).IndexOf(str, StringComparison.OrdinalIgnoreCase) > -1);
153154
}
154-
else
155+
else // Search by: Name, Hostname
155156
{
156-
return info.Name.IndexOf(search, StringComparison.OrdinalIgnoreCase) > -1;
157+
return info.Name.IndexOf(search, StringComparison.OrdinalIgnoreCase) > -1 || info.Host.IndexOf(search, StringComparison.OrdinalIgnoreCase) > -1;
157158
}
158159
};
159160

0 commit comments

Comments
 (0)