Skip to content

Commit 1c9c7d9

Browse files
committed
Default commands fixed
1 parent a9837ab commit 1c9c7d9

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed

Source/NETworkManager/GlobalStaticConfiguration.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,7 @@ public class GlobalStaticConfiguration
5959
public static int IPScanner_DNSTimeout => 2000;
6060
public static int IPScanner_ICMPTimeout => 4000;
6161
public static ExportManager.ExportFileType IPScanner_ExportFileType => ExportManager.ExportFileType.CSV;
62-
63-
public static ObservableCollection<CustomCommandInfo> IPScanner_CustomCommands => new ObservableCollection<CustomCommandInfo>
64-
{
65-
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer", "iexplore.exe", "http://$$ipaddress$$/"),
66-
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer (https)", "iexplore.exe", "https://$$ipaddress$$/"),
67-
};
68-
62+
6963
// Application: Port Scanner
7064
public static int PortScanner_HostThreads => 5;
7165
public static int PortScanner_PortThreds => 100;

Source/NETworkManager/Models/Network/DNSServer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace NETworkManager.Models.Network
44
{
55
public static class DNSServer
66
{
7-
public static List<DNSServerInfo> DefaultDNSServerList()
7+
public static List<DNSServerInfo> DefaultList()
88
{
99
return new List<DNSServerInfo>
1010
{

Source/NETworkManager/Models/Settings/SettingsInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ public int IPScanner_ICMPTimeout
752752
}
753753
}
754754

755-
private ObservableCollection<CustomCommandInfo> _ipScanner_CustomCommands = GlobalStaticConfiguration.IPScanner_CustomCommands;
755+
private ObservableCollection<CustomCommandInfo> _ipScanner_CustomCommands = new ObservableCollection<CustomCommandInfo>();
756756
public ObservableCollection<CustomCommandInfo> IPScanner_CustomCommands
757757
{
758758
get => _ipScanner_CustomCommands;

Source/NETworkManager/Utilities/CustomCommand.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
24

35
namespace NETworkManager.Utilities
46
{
57
public static class CustomCommand
68
{
9+
public static List<CustomCommandInfo> DefaultList()
10+
{
11+
return new List<CustomCommandInfo>
12+
{
13+
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer", "iexplore.exe", "http://$$ipaddress$$/"),
14+
new CustomCommandInfo(Guid.NewGuid(), "Internet Explorer (https)", "iexplore.exe", "https://$$ipaddress$$/"),
15+
};
16+
}
17+
718
public static void Run(CustomCommandInfo info)
819
{
920
if (string.IsNullOrEmpty(info.Arguments))

Source/NETworkManager/ViewModels/DNSLookupViewModel.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ public DNSLookupViewModel(IDialogCoordinator instance, int tabId, string host)
262262

263263
HostHistoryView = CollectionViewSource.GetDefaultView(SettingsManager.Current.DNSLookup_HostHistory);
264264

265+
// Add default DNS server...
265266
if (SettingsManager.Current.DNSLookup_DNSServers.Count == 0)
266-
SettingsManager.Current.DNSLookup_DNSServers = new ObservableCollection<DNSServerInfo>(Models.Network.DNSServer.DefaultDNSServerList());
267+
SettingsManager.Current.DNSLookup_DNSServers = new ObservableCollection<DNSServerInfo>(Models.Network.DNSServer.DefaultList());
267268

268269
DNSServers = new CollectionViewSource { Source = SettingsManager.Current.DNSLookup_DNSServers }.View;
269270
DNSServers.SortDescriptions.Add(new SortDescription(nameof(DNSServerInfo.UseWindowsDNSServer), ListSortDirection.Descending));

Source/NETworkManager/ViewModels/IPScannerViewModel.cs

+4
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ public IPScannerViewModel(IDialogCoordinator instance, int tabId, string hostOrI
297297
HostResultsView = CollectionViewSource.GetDefaultView(HostResults);
298298
HostResultsView.SortDescriptions.Add(new SortDescription(nameof(HostInfo.PingInfo) + "." + nameof(PingInfo.IPAddressInt32), ListSortDirection.Ascending));
299299

300+
// Add default custom commands...
301+
if (SettingsManager.Current.IPScanner_CustomCommands.Count == 0)
302+
SettingsManager.Current.IPScanner_CustomCommands = new ObservableCollection<CustomCommandInfo>(Utilities.CustomCommand.DefaultList());
303+
300304
LoadSettings();
301305

302306
// Detect if settings have changed...

0 commit comments

Comments
 (0)