Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Source/NETworkManager.Localization/Resources/Strings.ko-KR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
<value>테마</value>
</data>
<data name="Traceroute" xml:space="preserve">
<value>추적 경로</value>
<value>경로 추적</value>
</data>
<data name="Tray" xml:space="preserve">
<value>트레이</value>
Expand Down Expand Up @@ -828,7 +828,7 @@
<value>종료시간</value>
</data>
<data name="EnterASubnetToCalculateItDots" xml:space="preserve">
<value>서브넷을 입력하여 계산...</value>
<value>계산할 서브넷을 입력하세요...</value>
</data>
<data name="EnterSubnetAndANewSubnetmaskToCreateSubnets" xml:space="preserve">
<value>서브넷과 새 서브넷 마스크를 입력하여 서브넷을 만듭니다...</value>
Expand Down Expand Up @@ -888,7 +888,7 @@
<value>로컬 포트</value>
</data>
<data name="MACAddressOrVendor" xml:space="preserve">
<value>MAC 주소 또는 공급 업체</value>
<value>MAC 주소 또는 공급업체</value>
</data>
<data name="MagicPacketSentMessage" xml:space="preserve">
<value>매직 패킷이 성공적으로 전송되었습니다!</value>
Expand Down Expand Up @@ -1184,7 +1184,7 @@
<value>사용자 이름</value>
</data>
<data name="Vendor" xml:space="preserve">
<value>공급 업체</value>
<value>공급업체</value>
</data>
<data name="Version" xml:space="preserve">
<value>버전</value>
Expand Down Expand Up @@ -2512,7 +2512,7 @@ $$hostname$$ --&gt; 호스트이름</value>
<value>TigerVNC</value>
</data>
<data name="ApplicationName_Traceroute" xml:space="preserve">
<value>추적 경로</value>
<value>경로 추적</value>
</data>
<data name="ApplicationName_WakeOnLAN" xml:space="preserve">
<value>Wake on LAN</value>
Expand Down Expand Up @@ -3153,7 +3153,7 @@ PowerShell 및 AWS Session Manager 설정에 구성된 PowerShell 콘솔만 수
<value>테라바이트</value>
</data>
<data name="EnterANumberAndSelectAUnitToCalculateTheUnitsDots" xml:space="preserve">
<value>숫자를 입력하고 단위를 선택하여 단위를 계산하세요...</value>
<value>계산할 숫자를 입력하고 단위를 선택하세요...</value>
</data>
<data name="SettingsName_Network" xml:space="preserve">
<value>네트워크</value>
Expand Down Expand Up @@ -3991,18 +3991,18 @@ Windows 설정 &gt; 개인정보 보호 및 보안 &gt; 위치를 열고 데스
<value>사용자 지정 테마를 사용하여 응용 프로그램의 모양을 개인화합니다. "프로그램 폴더 &gt; 테마" 디렉터리에서 테마를 편집하거나 추가할 수 있습니다. 자세한 내용은 설명서를 참조하세요.</value>
</data>
<data name="AdminConsoleSession" xml:space="preserve">
<value>Admin (console) session</value>
<value>관리자 (콘솔) 세션</value>
</data>
<data name="DeleteProfileFileXMessage" xml:space="preserve">
<value>Profile file "{0}" will be deleted permanently.</value>
<value>프로필 파일 "{0}"이 영구적으로 삭제됩니다.</value>
</data>
<data name="EnableEncryptionQuestion" xml:space="preserve">
<value>Enable encryption?</value>
<value>암호화를 활성화하시겠습니까?</value>
</data>
<data name="EnableEncryptionForProfileFileMessage" xml:space="preserve">
<value>Do you want to enable profile file encryption to protect sensitive data such as hosts, IP addresses, URLs, and stored credentials?
<value>호스트, IP 주소, URL, 저장된 자격 증명과 같은 민감한 데이터를 보호하기 위해 프로필 파일 암호화를 활성화하시겠습니까?

You can enable or disable encryption later at any time by right-clicking the profile file to manage encryption settings.
If you click Cancel, the profile file will remain unencrypted.</value>
나중에 언제든지 프로필 파일을 마우스 오른쪽 버튼으로 클릭하여 암호화 설정을 관리하여 암호화를 활성화 또는 비활성화할 수 있습니다.
"취소"를 클릭하면 프로필 파일은 암호화되지 않은 상태로 유지됩니다.</value>
</data>
</root>
1 change: 1 addition & 0 deletions Source/NETworkManager.Utilities/SecureStringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static class SecureStringHelper
public static string ConvertToString(SecureString secureString)
{
var valuePtr = IntPtr.Zero;

try
{
valuePtr = Marshal.SecureStringToGlobalAllocUnicode(secureString);
Expand Down
98 changes: 98 additions & 0 deletions Source/NETworkManager/DialogHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using MahApps.Metro.SimpleChildWindow;
using NETworkManager.Localization.Resources;
using NETworkManager.Settings;
using NETworkManager.Utilities;
using NETworkManager.ViewModels;
using NETworkManager.Views;
using System.Threading.Tasks;
using System.Windows;

namespace NETworkManager
{
/// <summary>
/// Helper class for showing dialog messages.
/// </summary>
public static class DialogHelper
{
/// <summary>
/// Displays a modal message dialog with an OK button, allowing the user to acknowledge the message before
/// continuing.
/// </summary>
/// <remarks>The dialog is shown as a child window of the specified parent. The method is
/// asynchronous and returns when the dialog is dismissed by the user.</remarks>
/// <param name="parentWindow">The parent window that will host the message dialog. Cannot be null.</param>
/// <param name="title">The title text displayed in the message dialog window. Cannot be null.</param>
/// <param name="message">The main message content shown in the dialog. Cannot be null.</param>
/// <param name="icon">The icon to display in the dialog, indicating the message type. Defaults to Info if not specified.</param>
/// <param name="buttonOKText">The text to display on the OK button. If null, a default value is used.</param>
/// <returns>A task that completes when the user closes the message dialog.</returns>
public static Task ShowOKMessageAsync(Window parentWindow, string title, string message, ChildWindowIcon icon = ChildWindowIcon.Info, string buttonOKText = null)
{
buttonOKText ??= Strings.OK;

var childWindow = new OKMessageChildWindow();

var childWindowViewModel = new OKMessageViewModel(_ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;
}, message, icon, buttonOKText);

childWindow.Title = title;

childWindow.DataContext = childWindowViewModel;

ConfigurationManager.Current.IsChildWindowOpen = true;

return parentWindow.ShowChildWindowAsync(childWindow);
}

/// <summary>
/// Displays an asynchronous modal dialog with OK and Cancel buttons, allowing the user to confirm or cancel an
/// action.
/// </summary>
/// <remarks>The dialog is shown as a child window of the specified parent. The method does not
/// return until the user closes the dialog. Custom button text and icon can be provided to tailor the dialog to
/// specific scenarios.</remarks>
/// <param name="parentWindow">The parent window that hosts the child dialog. Cannot be null.</param>
/// <param name="title">The title text displayed in the dialog window.</param>
/// <param name="message">The message content shown to the user in the dialog.</param>
/// <param name="icon">The icon displayed in the dialog to indicate the message type. Defaults to Info.</param>
/// <param name="buttonOKText">The text label for the OK button. If null, a default value is used.</param>
/// <param name="buttonCancelText">The text label for the Cancel button. If null, a default value is used.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <see langword="true"/> if the user
/// clicks OK; otherwise, <see langword="false"/>.</returns>
public static async Task<bool> ShowOKCancelMessageAsync(Window parentWindow, string title, string message, ChildWindowIcon icon = ChildWindowIcon.Info, string buttonOKText = null, string buttonCancelText = null)
{
buttonOKText ??= Strings.OK;
buttonCancelText ??= Strings.Cancel;

var result = false;

var childWindow = new OKCancelMessageChildWindow();

var childWindowViewModel = new OKCancelMessageViewModel(_ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;

result = true;
},
_ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;
},
message, icon, buttonOKText, buttonCancelText);

childWindow.Title = title;
childWindow.DataContext = childWindowViewModel;

ConfigurationManager.Current.IsChildWindowOpen = true;

await parentWindow.ShowChildWindowAsync(childWindow);

return result;
}
}
}
2 changes: 1 addition & 1 deletion Source/NETworkManager/NETworkManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Views\OKCancelInfoMessageChildWindow.xaml">
<Page Update="Views\OKCancelMessageChildWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<XamlRuntime>Wpf</XamlRuntime>
<SubType>Designer</SubType>
Expand Down
76 changes: 23 additions & 53 deletions Source/NETworkManager/ProfileDialogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using NETworkManager.Models.PuTTY;
using NETworkManager.Models.RemoteDesktop;
using NETworkManager.Profiles;
using NETworkManager.Utilities;
using NETworkManager.ViewModels;
using NETworkManager.Views;
using System;
Expand Down Expand Up @@ -560,39 +561,24 @@ public static Task ShowCopyAsProfileDialog(Window parentWindow, IProfileManagerM
return parentWindow.ShowChildWindowAsync(childWindow);
}

public static Task ShowDeleteProfileDialog(Window parentWindow, IProfileManagerMinimal viewModel,
public static async Task ShowDeleteProfileDialog(Window parentWindow, IProfileManagerMinimal viewModel,
IList<ProfileInfo> profiles)
{
var childWindow = new OKCancelInfoMessageChildWindow();

OKCancelInfoMessageViewModel childWindowViewModel = new(_ =>
{
childWindow.IsOpen = false;
Settings.ConfigurationManager.Current.IsChildWindowOpen = false;

viewModel.OnProfileManagerDialogClose();

ProfileManager.RemoveProfiles(profiles);
}, _ =>
{
childWindow.IsOpen = false;
Settings.ConfigurationManager.Current.IsChildWindowOpen = false;

viewModel.OnProfileManagerDialogClose();
},
profiles.Count == 1 ? Strings.DeleteProfileMessage : Strings.DeleteProfilesMessage,
Strings.Delete
);

childWindow.Title = profiles.Count == 1 ? Strings.DeleteProfile : Strings.DeleteProfiles;
viewModel.OnProfileManagerDialogOpen();

childWindow.DataContext = childWindowViewModel;
var result = await DialogHelper.ShowOKCancelMessageAsync(parentWindow,
profiles.Count == 1 ? Strings.DeleteProfile : Strings.DeleteProfiles,
profiles.Count == 1 ? Strings.DeleteProfileMessage : Strings.DeleteProfilesMessage,
ChildWindowIcon.Info,
Strings.Delete);

viewModel.OnProfileManagerDialogOpen();
viewModel.OnProfileManagerDialogClose();

Settings.ConfigurationManager.Current.IsChildWindowOpen = true;
if (!result)
return;

return parentWindow.ShowChildWindowAsync(childWindow);
ProfileManager.RemoveProfiles(profiles);
}

#endregion
Expand Down Expand Up @@ -662,40 +648,24 @@ public static Task ShowEditGroupDialog(Window parentWindow, IProfileManagerMinim
return parentWindow.ShowChildWindowAsync(childWindow);
}

public static Task ShowDeleteGroupDialog(Window parentWindow, IProfileManagerMinimal viewModel,
public static async Task ShowDeleteGroupDialog(Window parentWindow, IProfileManagerMinimal viewModel,
GroupInfo group)
{
var childWindow = new OKCancelInfoMessageChildWindow();

OKCancelInfoMessageViewModel childWindowViewModel = new(_ =>
{
childWindow.IsOpen = false;
Settings.ConfigurationManager.Current.IsChildWindowOpen = false;

viewModel.OnProfileManagerDialogClose();

ProfileManager.RemoveGroup(group);
}, _ =>
{
childWindow.IsOpen = false;
Settings.ConfigurationManager.Current.IsChildWindowOpen = false;
viewModel.OnProfileManagerDialogOpen();

viewModel.OnProfileManagerDialogClose();
},
var result = await DialogHelper.ShowOKCancelMessageAsync(parentWindow,
Strings.DeleteGroup,
Strings.DeleteGroupMessage,
Strings.Delete
);

childWindow.Title = Strings.DeleteGroup;
ChildWindowIcon.Info,
Strings.Delete);

childWindow.DataContext = childWindowViewModel;
viewModel.OnProfileManagerDialogClose();

viewModel.OnProfileManagerDialogOpen();
if (!result)
return;

Settings.ConfigurationManager.Current.IsChildWindowOpen = true;

return parentWindow.ShowChildWindowAsync(childWindow);
ProfileManager.RemoveGroup(group);
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,32 +275,19 @@ public async Task EditAWSProfile()
await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog);
}

private Task DeleteAWSProfile()
private async Task DeleteAWSProfile()
{
var childWindow = new OKCancelInfoMessageChildWindow();
var result = await DialogHelper.ShowOKCancelMessageAsync(Application.Current.MainWindow,
Strings.DeleteAWSProfile,
Strings.DeleteAWSProfileMessage,
ChildWindowIcon.Info,
Strings.Delete);

var childWindowViewModel = new OKCancelInfoMessageViewModel(_ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;

SettingsManager.Current.AWSSessionManager_AWSProfiles.Remove(SelectedAWSProfile);
}, _ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;
},
Strings.DeleteAWSProfileMessage,
Strings.Delete
);
if (!result)
return;

childWindow.Title = Strings.DeleteAWSProfile;

childWindow.DataContext = childWindowViewModel;

ConfigurationManager.Current.IsChildWindowOpen = true;

return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow);
SettingsManager.Current.AWSSessionManager_AWSProfiles.Remove(SelectedAWSProfile);
}

private async Task Configure()
Expand Down
32 changes: 9 additions & 23 deletions Source/NETworkManager/ViewModels/DNSLookupSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,32 +357,18 @@ public async Task EditDNSServer()
await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog);
}

private Task DeleteDNSServer()
private async Task DeleteDNSServer()
{
var childWindow = new OKCancelInfoMessageChildWindow();
var result = await DialogHelper.ShowOKCancelMessageAsync(Application.Current.MainWindow,
Strings.DeleteDNSServer,
Strings.DeleteDNSServerMessage,
ChildWindowIcon.Info,
Strings.Delete);

var childWindowViewModel = new OKCancelInfoMessageViewModel(_ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;

SettingsManager.Current.DNSLookup_DNSServers.Remove(SelectedDNSServer);
}, _ =>
{
childWindow.IsOpen = false;
ConfigurationManager.Current.IsChildWindowOpen = false;
},
Strings.DeleteDNSServerMessage,
Strings.Delete
);

childWindow.Title = Strings.DeleteDNSServer;

childWindow.DataContext = childWindowViewModel;

ConfigurationManager.Current.IsChildWindowOpen = true;
if (!result)
return;

return (Application.Current.MainWindow as MainWindow).ShowChildWindowAsync(childWindow);
SettingsManager.Current.DNSLookup_DNSServers.Remove(SelectedDNSServer);
}

#endregion
Expand Down
Loading