From a5e7fe49296d8f6afcc260e8d2daffabc423587a Mon Sep 17 00:00:00 2001 From: GALENS <260827400@qq.com> Date: Thu, 16 Mar 2023 17:44:02 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSAddinTest/Core/Command/LoadPluginsWhenStartupCommand.cs | 4 +++- MSAddinTest/Core/Command/ReloadPluginCommand.cs | 2 +- MSAddinTest/Core/Command/UninstallCommand.cs | 2 +- MSAddinTest/Core/Command/UnloadPluginCommand.cs | 4 +++- MSAddinTest/Core/Command/UpdateSettingsCommand.cs | 4 +++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/MSAddinTest/Core/Command/LoadPluginsWhenStartupCommand.cs b/MSAddinTest/Core/Command/LoadPluginsWhenStartupCommand.cs index 675b441..61afa13 100644 --- a/MSAddinTest/Core/Command/LoadPluginsWhenStartupCommand.cs +++ b/MSAddinTest/Core/Command/LoadPluginsWhenStartupCommand.cs @@ -1,4 +1,5 @@ -using MSAddinTest.Core.Loader; +using Bentley.MstnPlatformNET; +using MSAddinTest.Core.Loader; using System; using System.Collections.Generic; using System.IO; @@ -27,6 +28,7 @@ public override FuncResult Start() } PluginContainer.Add(loader); + MessageCenter.Instance.ShowInfoMessage($"{loader.Setup.PluginName} 已自动加载!", "", false); } return new FuncResult(true); diff --git a/MSAddinTest/Core/Command/ReloadPluginCommand.cs b/MSAddinTest/Core/Command/ReloadPluginCommand.cs index ba059e0..42df282 100644 --- a/MSAddinTest/Core/Command/ReloadPluginCommand.cs +++ b/MSAddinTest/Core/Command/ReloadPluginCommand.cs @@ -22,7 +22,7 @@ public override FuncResult Start() if (PluginContainer.TryGetValue(_pluginName, out var container)) { container.Reload(); - System.Windows.MessageBox.Show("重载成功!"); + System.Windows.MessageBox.Show($"{_pluginName} 重载成功!"); } return new FuncResult(true); diff --git a/MSAddinTest/Core/Command/UninstallCommand.cs b/MSAddinTest/Core/Command/UninstallCommand.cs index ba809ce..91bee27 100644 --- a/MSAddinTest/Core/Command/UninstallCommand.cs +++ b/MSAddinTest/Core/Command/UninstallCommand.cs @@ -21,7 +21,7 @@ public override FuncResult Start() // 读取值并修改 string configContent = File.ReadAllText(personalConfPath); - string autoloadSentence = "\r\n%level Organization\r\nMS_DGNAPPS > MSAddinTest"; + string autoloadSentence = "\r\nMS_DGNAPPS > MSAddinTest"; if (configContent.Contains(autoloadSentence)) { configContent = configContent.Replace(autoloadSentence, ""); diff --git a/MSAddinTest/Core/Command/UnloadPluginCommand.cs b/MSAddinTest/Core/Command/UnloadPluginCommand.cs index 2a37611..e9dd3bc 100644 --- a/MSAddinTest/Core/Command/UnloadPluginCommand.cs +++ b/MSAddinTest/Core/Command/UnloadPluginCommand.cs @@ -1,4 +1,5 @@ -using MSAddinTest.Core.Settings; +using Bentley.MstnPlatformNET; +using MSAddinTest.Core.Settings; using System; using System.Collections.Generic; using System.Linq; @@ -29,6 +30,7 @@ public override FuncResult Start() // 从存储中去掉记录 PluginSetting.RemovePluginSetting(_pluginNameToUnload); + MessageCenter.Instance.ShowInfoMessage($"{_pluginNameToUnload} 已卸载!", "", false); return new FuncResult(true); } } diff --git a/MSAddinTest/Core/Command/UpdateSettingsCommand.cs b/MSAddinTest/Core/Command/UpdateSettingsCommand.cs index c9ec38b..338d566 100644 --- a/MSAddinTest/Core/Command/UpdateSettingsCommand.cs +++ b/MSAddinTest/Core/Command/UpdateSettingsCommand.cs @@ -1,4 +1,5 @@ -using MSAddinTest.Core.Settings; +using Bentley.MstnPlatformNET; +using MSAddinTest.Core.Settings; using System; using System.Collections.Generic; using System.Linq; @@ -79,6 +80,7 @@ public override FuncResult Start() // 保存设置 PluginSetting.Save(); + MessageCenter.Instance.ShowInfoMessage("设置已保存!", "", false); return new FuncResult(true); } }