将 NotificationHelper.ShowMessage改为具体的ShowError得方法

This commit is contained in:
2025-07-06 15:36:53 +08:00
parent b0874a4f02
commit 0980f84d09
13 changed files with 45 additions and 55 deletions

View File

@@ -43,7 +43,7 @@ public partial class MainView : Window
}
else
{
NotificationHelper.ShowMessage("选择的菜单项为空!", NotificationType.Error);
NotificationHelper.ShowError("选择的菜单项为空!");
}
}

View File

@@ -40,7 +40,7 @@ public partial class VariableTableView : UserControl
}
catch (Exception exception)
{
NotificationHelper.ShowMessage($"修改变量表启用,停用时发生了错误:{exception.Message}");
NotificationHelper.ShowError($"修改变量表启用,停用时发生了错误:{exception.Message}", exception);
}
}
@@ -103,9 +103,7 @@ public partial class VariableTableView : UserControl
}
catch (Exception e)
{
string msg = "编辑变量表数据时发生了错误:";
Logger.Error(msg + e);
NotificationHelper.ShowMessage(msg + e.Message, NotificationType.Error);
NotificationHelper.ShowError("变量表编辑的过过程中发生了错误:" + e.Message, e);
}
}
@@ -119,7 +117,7 @@ public partial class VariableTableView : UserControl
}
else
{
NotificationHelper.ShowMessage("请选择要删除的变量", NotificationType.Warning);
NotificationHelper.ShowInfo("请选择要删除的变量");
}
}
@@ -135,14 +133,12 @@ public partial class VariableTableView : UserControl
}
else
{
NotificationHelper.ShowMessage("请选择要修改轮询频率的变量", NotificationType.Warning);
NotificationHelper.ShowInfo("请选择要修改轮询频率的变量");
}
}
catch (Exception e)
{
string msg = "修改轮询时间时发生了错误:";
Logger.Error(msg + e);
NotificationHelper.ShowMessage(msg + e.Message, NotificationType.Error);
NotificationHelper.ShowError("修改轮询频率的过程中发生了错误:" + e.Message, e);
}
}
@@ -158,14 +154,12 @@ public partial class VariableTableView : UserControl
}
else
{
NotificationHelper.ShowMessage("请选择要添加MQTT服务器的变量", NotificationType.Warning);
NotificationHelper.ShowInfo("请选择要添加MQTT服务器的变量");
}
}
catch (Exception ex)
{
string msg = "添加MQTT服务器发生了错误:";
Logger.Error(msg + ex);
NotificationHelper.ShowMessage(msg + ex.Message, NotificationType.Error);
NotificationHelper.ShowError("给变量添加MQTT服务器的过程中发生了错误:" + ex.Message, ex);
}
}
}