From 4179769b0a339b4cbad8b169957f3cd1460c225b Mon Sep 17 00:00:00 2001 From: Zaitonn <103164490+Zaitonn@users.noreply.github.com> Date: Sun, 29 Dec 2024 21:51:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A7=E5=88=B6=E5=8F=B0=E5=88=B7?= =?UTF-8?q?=E5=B1=8F=20fix:=20Lite=E7=89=88=E5=9C=A8=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=BF=90=E8=A1=8C=E4=B8=AD=E7=9A=84=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E6=97=B6=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Build.props | 2 +- .../Services/Commands/HardwareInfoProvider.cs | 3 +-- src/Serein.Lite/Ui/MainForm.cs | 25 ++++++++++++------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index fbd4433d..02c06194 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.0.0.0-rc0 + 2.0.0.0-rc1 Zaitonn Copyright (C) 2022 Zaitonn Serein diff --git a/src/Serein.Core/Services/Commands/HardwareInfoProvider.cs b/src/Serein.Core/Services/Commands/HardwareInfoProvider.cs index a70b0bbd..85e9b1bc 100644 --- a/src/Serein.Core/Services/Commands/HardwareInfoProvider.cs +++ b/src/Serein.Core/Services/Commands/HardwareInfoProvider.cs @@ -94,8 +94,7 @@ void Try( } catch (Exception e) { - _logger.LogError("更新信息失败:{}({})", e.Message, expression); - _logger.LogDebug(e, "更新信息失败"); + _logger.LogDebug(e, "更新信息失败:({})", expression); } } } diff --git a/src/Serein.Lite/Ui/MainForm.cs b/src/Serein.Lite/Ui/MainForm.cs index a3bd4ce4..3d74ba97 100644 --- a/src/Serein.Lite/Ui/MainForm.cs +++ b/src/Serein.Lite/Ui/MainForm.cs @@ -261,16 +261,23 @@ private void ServerRemoveToolStripMenuItem_Click(object sender, EventArgs e) return; } - var id = serverPage - .MainTabControl.Controls[serverPage.MainTabControl.SelectedIndex] - .Tag?.ToString(); - - if ( - !string.IsNullOrEmpty(id) - && MessageBoxHelper.ShowDeleteConfirmation($"确定要删除此服务器配置({id})吗?") - ) + try + { + var id = serverPage + .MainTabControl.Controls[serverPage.MainTabControl.SelectedIndex] + .Tag?.ToString(); + + if ( + !string.IsNullOrEmpty(id) + && MessageBoxHelper.ShowDeleteConfirmation($"确定要删除此服务器配置({id})吗?") + ) + { + _serverManager.Remove(id); + } + } + catch (Exception ex) { - _serverManager.Remove(id); + MessageBoxHelper.ShowWarningMsgBox("删除失败:\r\n" + ex.Message); } }