Skip to content

Commit ce9970e

Browse files
committed
Localization improved, bug fixed
1 parent e140d36 commit ce9970e

5 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎Source/NETworkManager/Converters/PortStatusToStringConverter.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
1212
if (!(value is PortStatus portStatus))
1313
return "-/-";
1414

15-
var status = Resources.Localization.Strings.ResourceManager.GetString(portStatus.ToString());
15+
var status = Resources.Localization.Strings.ResourceManager.GetString("PortState_" + portStatus);
1616

1717
return string.IsNullOrEmpty(status) ? portStatus.ToString() : status;
1818
}

‎Source/NETworkManager/Models/Network/PortScanner.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void ScanAsync(List<Tuple<IPAddress, string>> hostData, int[] ports, Port
5151
_progressValue = 0;
5252

5353
// Modify the ThreadPool for better performance
54-
ThreadPool.GetMinThreads(out int workerThreads, out int completionPortThreads);
54+
ThreadPool.GetMinThreads(out var workerThreads, out var completionPortThreads);
5555
ThreadPool.SetMinThreads(workerThreads + portScannerOptions.Threads, completionPortThreads + portScannerOptions.Threads);
5656

5757
Task.Run(() =>

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

Lines changed: 18 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,4 +1935,10 @@
19351935
<data name="CredentialWithThisNameAlreadyExists" xml:space="preserve">
19361936
<value>Credential with this name already exists!</value>
19371937
</data>
1938+
<data name="PortState_Closed" xml:space="preserve">
1939+
<value>Closed</value>
1940+
</data>
1941+
<data name="PortState_Open" xml:space="preserve">
1942+
<value>Open</value>
1943+
</data>
19381944
</root>

‎Source/NETworkManager/ViewModels/RemoteDesktopHostViewModel.cs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System.Linq;
1212
using System.Diagnostics;
1313
using NETworkManager.Utilities;
14-
using System.Collections.Generic;
1514
using System.Windows;
1615

1716
namespace NETworkManager.ViewModels
@@ -558,7 +557,7 @@ private async void ConnectProfile()
558557
ConfigurationManager.Current.IsDialogOpen = true;
559558
await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog);
560559
}
561-
else // Connect already unlocked
560+
else // already unlocked
562561
{
563562
var credentialInfo = CredentialManager.GetCredentialByID(SelectedProfile.CredentialID);
564563

@@ -612,9 +611,9 @@ private async void ConnectProfileAs()
612611
}
613612
else
614613
{
615-
if (instance.CredentialID != null)
614+
if (instance.CredentialID != Guid.Empty)
616615
{
617-
var credentialInfo = CredentialManager.GetCredentialByID((Guid)instance.CredentialID);
616+
var credentialInfo = CredentialManager.GetCredentialByID(instance.CredentialID);
618617

619618
session.Username = credentialInfo.Username;
620619
session.Password = credentialInfo.Password;
@@ -684,7 +683,7 @@ public void AddTab(string host)
684683
}
685684

686685
// Modify history list
687-
private void AddHostToHistory(string host)
686+
private static void AddHostToHistory(string host)
688687
{
689688
// Create the new list
690689
var list = ListHelper.Modify(SettingsManager.Current.RemoteDesktop_HostHistory.ToList(), host, SettingsManager.Current.General_HistoryListEntries);

0 commit comments

Comments
 (0)