Skip to content

Commit 72cb31d

Browse files
committed
Hosts added
1 parent 7855c07 commit 72cb31d

15 files changed

+844
-39
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Net;
2+
3+
namespace NETworkManager.Models.Network
4+
{
5+
public class PingMonitorOptions
6+
{
7+
public string Host { get; set; }
8+
public IPAddress IPAddress { get; set; }
9+
10+
public PingMonitorOptions(string host, IPAddress ipAddress)
11+
{
12+
Host = host;
13+
IPAddress = ipAddress;
14+
}
15+
}
16+
}

Source/NETworkManager/Models/Settings/ProfileInfo.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public class ProfileInfo
3535
public bool Ping_InheritHost { get; set; } = true;
3636
public string Ping_Host { get; set; }
3737

38+
public bool PingMonitor_Enabled { get; set; }
39+
public bool PingMonitor_InheritHost { get; set; } = true;
40+
public string PingMonitor_Host { get; set; }
41+
3842
public bool Traceroute_Enabled { get; set; }
3943
public bool Traceroute_InheritHost { get; set; } = true;
4044
public string Traceroute_Host { get; set; }

Source/NETworkManager/Models/Settings/SettingsInfo.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,69 @@ public bool Ping_HighlightTimeouts
14331433
}
14341434
#endregion
14351435

1436+
#region Ping Monitor
1437+
private ObservableCollection<string> _pingMonitor_HostHistory = new ObservableCollection<string>();
1438+
public ObservableCollection<string> PingMonitor_HostHistory
1439+
{
1440+
get => _pingMonitor_HostHistory;
1441+
set
1442+
{
1443+
if (value == _pingMonitor_HostHistory)
1444+
return;
1445+
1446+
_pingMonitor_HostHistory = value;
1447+
OnPropertyChanged();
1448+
SettingsChanged = true;
1449+
}
1450+
}
1451+
1452+
private bool _pingMonitor_ResolveHostnamePreferIPv4 = true;
1453+
public bool PingMonitor_ResolveHostnamePreferIPv4
1454+
{
1455+
get => _pingMonitor_ResolveHostnamePreferIPv4;
1456+
set
1457+
{
1458+
if (value == _pingMonitor_ResolveHostnamePreferIPv4)
1459+
return;
1460+
1461+
_pingMonitor_ResolveHostnamePreferIPv4 = value;
1462+
OnPropertyChanged();
1463+
SettingsChanged = true;
1464+
}
1465+
}
1466+
1467+
1468+
private bool _pingMonitor_ExpandProfileView = true;
1469+
public bool PingMonitor_ExpandProfileView
1470+
{
1471+
get => _pingMonitor_ExpandProfileView;
1472+
set
1473+
{
1474+
if (value == _pingMonitor_ExpandProfileView)
1475+
return;
1476+
1477+
_pingMonitor_ExpandProfileView = value;
1478+
OnPropertyChanged();
1479+
SettingsChanged = true;
1480+
}
1481+
}
1482+
1483+
private double _pingMonitor_ProfileWidth = GlobalStaticConfiguration.Profile_DefaultWidthExpanded;
1484+
public double PingMonitor_ProfileWidth
1485+
{
1486+
get => _pingMonitor_ProfileWidth;
1487+
set
1488+
{
1489+
if (Math.Abs(value - _pingMonitor_ProfileWidth) < GlobalStaticConfiguration.FloatPointFix)
1490+
return;
1491+
1492+
_pingMonitor_ProfileWidth = value;
1493+
OnPropertyChanged();
1494+
SettingsChanged = true;
1495+
}
1496+
}
1497+
#endregion
1498+
14361499
#region Traceroute
14371500
private ObservableCollection<string> _traceroute_HostHistory = new ObservableCollection<string>();
14381501
public ObservableCollection<string> Traceroute_HostHistory

Source/NETworkManager/NETworkManager.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
<Compile Include="Models\Network\BandwidthMeterSpeedArgs.cs" />
181181
<Compile Include="Models\Network\DNSServer.cs" />
182182
<Compile Include="Models\Network\DNSServerInfo.cs" />
183+
<Compile Include="Models\Network\PingMonitorOptions.cs" />
183184
<Compile Include="Models\Network\WiFiAdapterInfo.cs" />
184185
<Compile Include="Models\Network\WiFiNetworkInfo.cs" />
185186
<Compile Include="Models\Network\WiFi.cs" />
@@ -269,6 +270,7 @@
269270
<Compile Include="Validators\IPv4IPv6SubnetValidator.cs" />
270271
<Compile Include="ViewModels\CustomCommandViewModel.cs" />
271272
<Compile Include="ViewModels\PingMonitorViewModel.cs" />
273+
<Compile Include="ViewModels\PingMonitorClientViewModel.cs" />
272274
<Compile Include="ViewModels\WiFiViewModel.cs" />
273275
<Compile Include="ViewModels\FirstRunViewModel.cs" />
274276
<Compile Include="Models\Settings\IProfileManager.cs" />
@@ -344,6 +346,9 @@
344346
<Compile Include="Views\PingMonitorView.xaml.cs">
345347
<DependentUpon>PingMonitorView.xaml</DependentUpon>
346348
</Compile>
349+
<Compile Include="Views\PingMonitorClientView.xaml.cs">
350+
<DependentUpon>PingMonitorClientView.xaml</DependentUpon>
351+
</Compile>
347352
<Compile Include="Views\WiFiView.xaml.cs">
348353
<DependentUpon>WiFiView.xaml</DependentUpon>
349354
</Compile>
@@ -697,6 +702,10 @@
697702
<Generator>MSBuild:Compile</Generator>
698703
<SubType>Designer</SubType>
699704
</Page>
705+
<Page Include="Views\PingMonitorClientView.xaml">
706+
<Generator>MSBuild:Compile</Generator>
707+
<SubType>Designer</SubType>
708+
</Page>
700709
<Page Include="Views\WiFiView.xaml">
701710
<Generator>MSBuild:Compile</Generator>
702711
<SubType>Designer</SubType>

Source/NETworkManager/Resources/Localization/Strings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager/Resources/Localization/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,4 +2456,7 @@ URL: https://github.com/BornToBeRoot/NETworkManager/issues/new/choose</value>
24562456
<data name="PingMonitor" xml:space="preserve">
24572457
<value>Ping Monitor</value>
24582458
</data>
2459+
<data name="AddHost" xml:space="preserve">
2460+
<value>Add host</value>
2461+
</data>
24592462
</root>

Source/NETworkManager/ViewModels/IPScannerViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public IPScannerViewModel(IDialogCoordinator instance, int tabId, string hostOrI
305305
_tabId = tabId;
306306
Host = hostOrIPRange;
307307

308-
// Set collection view
308+
// Host history
309309
HostHistoryView = CollectionViewSource.GetDefaultView(SettingsManager.Current.IPScanner_HostHistory);
310310

311311
// Result view

0 commit comments

Comments
 (0)