Skip to content

Commit

Permalink
Fix: #2614 due to #2586 (#2615)
Browse files Browse the repository at this point in the history
* Fix: #2614 due to #2586

* Chore: Apply JetBrains Rider style & code cleanup
  • Loading branch information
BornToBeRoot authored Jan 7, 2024
1 parent fb531f5 commit 9e74521
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Source/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("2024.1.6.0")]
[assembly: AssemblyFileVersion("2024.1.6.0")]
[assembly: AssemblyFileVersion("2024.1.6.0")]
124 changes: 62 additions & 62 deletions Source/NETworkManager.Documentation/DocumentationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,63 +22,63 @@ public static class DocumentationManager
/// </summary>
private static IEnumerable<DocumentationInfo> List =>
[
new DocumentationInfo(DocumentationIdentifier.ApplicationDashboard,
new DocumentationInfo(DocumentationIdentifier.ApplicationDashboard,
@"docs/application/dashboard"),

new DocumentationInfo(DocumentationIdentifier.ApplicationNetworkInterface,
@"docs/application/network-interface"),

new DocumentationInfo(DocumentationIdentifier.ApplicationWiFi,
new DocumentationInfo(DocumentationIdentifier.ApplicationWiFi,
@"docs/application/wifi"),
new DocumentationInfo(DocumentationIdentifier.ApplicationIPScanner,

new DocumentationInfo(DocumentationIdentifier.ApplicationIPScanner,
@"docs/application/ip-scanner"),
new DocumentationInfo(DocumentationIdentifier.ApplicationPortScanner,

new DocumentationInfo(DocumentationIdentifier.ApplicationPortScanner,
@"docs/application/port-scanner"),
new DocumentationInfo(DocumentationIdentifier.ApplicationPingMonitor,

new DocumentationInfo(DocumentationIdentifier.ApplicationPingMonitor,
@"docs/application/ping-monitor"),
new DocumentationInfo(DocumentationIdentifier.ApplicationTraceroute,

new DocumentationInfo(DocumentationIdentifier.ApplicationTraceroute,
@"docs/application/traceroute"),
new DocumentationInfo(DocumentationIdentifier.ApplicationDnsLookup,

new DocumentationInfo(DocumentationIdentifier.ApplicationDnsLookup,
@"docs/application/dns-lookup"),

new DocumentationInfo(DocumentationIdentifier.ApplicationRemoteDesktop,
@"docs/application/remote-desktop"),

new DocumentationInfo(DocumentationIdentifier.ApplicationPowerShell,
new DocumentationInfo(DocumentationIdentifier.ApplicationPowerShell,
@"docs/application/powershell"),
new DocumentationInfo(DocumentationIdentifier.ApplicationPutty,

new DocumentationInfo(DocumentationIdentifier.ApplicationPutty,
@"docs/application/putty"),

new DocumentationInfo(DocumentationIdentifier.ApplicationAWSSessionManager,
@"docs/application/aws-session-manager"),

new DocumentationInfo(DocumentationIdentifier.ApplicationTigerVNC,
new DocumentationInfo(DocumentationIdentifier.ApplicationTigerVNC,
@"docs/application/tigervnc"),
new DocumentationInfo(DocumentationIdentifier.ApplicationWebConsole,

new DocumentationInfo(DocumentationIdentifier.ApplicationWebConsole,
@"docs/application/web-console"),
new DocumentationInfo(DocumentationIdentifier.ApplicationSnmp,

new DocumentationInfo(DocumentationIdentifier.ApplicationSnmp,
@"docs/application/snmp"),

new DocumentationInfo(DocumentationIdentifier.ApplicationSntpLookup,
@"docs/application/sntp-lookup"),

new DocumentationInfo(DocumentationIdentifier.ApplicationDiscoveryProtocol,
@"docs/application/discovery-protocol"),

new DocumentationInfo(DocumentationIdentifier.ApplicationWakeOnLan,
new DocumentationInfo(DocumentationIdentifier.ApplicationWakeOnLan,
@"docs/application/wake-on-lan"),
new DocumentationInfo(DocumentationIdentifier.ApplicationWhois,

new DocumentationInfo(DocumentationIdentifier.ApplicationWhois,
@"docs/application/whois"),

new DocumentationInfo(DocumentationIdentifier.ApplicationIPGeolocation,
@"docs/application/ip-geolocation"),

Expand All @@ -88,55 +88,55 @@ public static class DocumentationManager
new DocumentationInfo(DocumentationIdentifier.ApplicationBitCalculator,
@"docs/application/bit-calculator"),

new DocumentationInfo(DocumentationIdentifier.ApplicationLookup,
new DocumentationInfo(DocumentationIdentifier.ApplicationLookup,
@"docs/application/lookup"),
new DocumentationInfo(DocumentationIdentifier.ApplicationConnections,

new DocumentationInfo(DocumentationIdentifier.ApplicationConnections,
@"docs/application/connection"),
new DocumentationInfo(DocumentationIdentifier.ApplicationListeners,

new DocumentationInfo(DocumentationIdentifier.ApplicationListeners,
@"docs/application/listeners"),
new DocumentationInfo(DocumentationIdentifier.ApplicationArpTable,

new DocumentationInfo(DocumentationIdentifier.ApplicationArpTable,
@"docs/application/arp-table"),
new DocumentationInfo(DocumentationIdentifier.SettingsGeneral,

new DocumentationInfo(DocumentationIdentifier.SettingsGeneral,
@"docs/settings/general"),
new DocumentationInfo(DocumentationIdentifier.SettingsWindow,

new DocumentationInfo(DocumentationIdentifier.SettingsWindow,
@"docs/settings/window"),
new DocumentationInfo(DocumentationIdentifier.SettingsAppearance,

new DocumentationInfo(DocumentationIdentifier.SettingsAppearance,
@"docs/settings/appearance"),
new DocumentationInfo(DocumentationIdentifier.SettingsLanguage,

new DocumentationInfo(DocumentationIdentifier.SettingsLanguage,
@"docs/settings/language"),
new DocumentationInfo(DocumentationIdentifier.SettingsNetwork,

new DocumentationInfo(DocumentationIdentifier.SettingsNetwork,
@"docs/settings/network"),
new DocumentationInfo(DocumentationIdentifier.SettingsStatus,

new DocumentationInfo(DocumentationIdentifier.SettingsStatus,
@"docs/settings/status"),
new DocumentationInfo(DocumentationIdentifier.SettingsHotKeys,

new DocumentationInfo(DocumentationIdentifier.SettingsHotKeys,
@"docs/settings/hotkeys"),
new DocumentationInfo(DocumentationIdentifier.SettingsAutostart,

new DocumentationInfo(DocumentationIdentifier.SettingsAutostart,
@"docs/settings/autostart"),
new DocumentationInfo(DocumentationIdentifier.SettingsUpdate,

new DocumentationInfo(DocumentationIdentifier.SettingsUpdate,
@"docs/settings/update"),
new DocumentationInfo(DocumentationIdentifier.SettingsProfiles,

new DocumentationInfo(DocumentationIdentifier.SettingsProfiles,
@"docs/settings/profiles"),
new DocumentationInfo(DocumentationIdentifier.SettingsSettings,

new DocumentationInfo(DocumentationIdentifier.SettingsSettings,
@"docs/settings/settings"),
new DocumentationInfo(DocumentationIdentifier.Profiles,

new DocumentationInfo(DocumentationIdentifier.Profiles,
@"Documentation/profiles"),
new DocumentationInfo(DocumentationIdentifier.CommandLineArguments,

new DocumentationInfo(DocumentationIdentifier.CommandLineArguments,
@"docs/commandline-arguments")
];

Expand Down
13 changes: 7 additions & 6 deletions Source/NETworkManager.Models/Network/DNSLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void ResolveAsync(IEnumerable<string> hosts)
};
LookupClient lookupClient = new(lookupClientOptions);
// Get the dns server hostname for some additional information
var dnsServerHostName = string.Empty;
Expand All @@ -146,12 +146,13 @@ public void ResolveAsync(IEnumerable<string> hosts)
if (!result.HasError)
{
var record = result.Answers.PtrRecords().FirstOrDefault();
if (record != null)
dnsServerHostName = record.PtrDomainName;
}
}
catch {
catch
{
// ignored
}
Expand All @@ -170,18 +171,18 @@ public void ResolveAsync(IEnumerable<string> hosts)
{
OnLookupError(new DNSLookupErrorArgs(query, $"{dnsServer.Address}",
$"{dnsServer.Address}:{dnsServer.Port}", dnsResponse.ErrorMessage));
return; // continue
}
if (dnsResponse.Answers.Count == 0)
{
var digAdditionalCommand = _settings.QueryType == QueryType.PTR ? " -x " : " ";
OnLookupError(new DNSLookupErrorArgs(query, $"{dnsServer.Address}",
$"{dnsServer.Address}:{dnsServer.Port}",
$"No DNS resource records received for query \"{query}\" (Query type: \"{_settings.QueryType}\") and the DNS server did not return an error. Try to check your DNS server with: dig @{dnsServer.Address}{digAdditionalCommand}{query}"));
return; // continue
}
Expand Down
39 changes: 39 additions & 0 deletions Source/NETworkManager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,45 @@
<converters:ApplicationNameToTranslatedStringConverter x:Key="ApplicationNameToTranslatedStringConverter" />
<converters:ApplicationNameToIconConverter x:Key="ApplicationNameToIconConverter" />
<converters:IntZeroToVisibilityCollapsedConverter x:Key="IntZeroToVisibilityCollapsedConverter" />
<!-- ReSharper disable once Xaml.RedundantResource - Used in TrayIcon -->
<ContextMenu x:Key="ContextMenuNotifyIcon" MinWidth="200" Opened="ContextMenu_Opened" x:Shared="False">
<MenuItem Header="{x:Static localization:Strings.Show}" Command="{Binding ShowWindowCommand}">
<MenuItem.Icon>
<Rectangle Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=OpenInNew}" />
</Rectangle.OpacityMask>
</Rectangle>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static localization:Strings.Status}" Command="{Binding OpenStatusWindowCommand}">
<MenuItem.Icon>
<Rectangle Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Pulse}" />
</Rectangle.OpacityMask>
</Rectangle>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static localization:Strings.Settings}" Command="{Binding OpenSettingsFromTrayCommand}">
<MenuItem.Icon>
<Rectangle Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:MaterialLight Kind=Cog}" />
</Rectangle.OpacityMask>
</Rectangle>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static localization:Strings.Close}" Command="{Binding CloseApplicationCommand}">
<MenuItem.Icon>
<Rectangle Width="16" Height="16" Fill="Red">
<Rectangle.OpacityMask>
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=WindowClose}" />
</Rectangle.OpacityMask>
</Rectangle>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</mah:MetroWindow.Resources>
<mah:MetroWindow.TitleTemplate>
<DataTemplate>
Expand Down

0 comments on commit 9e74521

Please sign in to comment.