Skip to content

Commit 3912c78

Browse files
committed
- [PluginManager] fix bug: when remove plugin success, the ui will crash
- [PluginManager] update version to 1.4.2.1
1 parent 299c369 commit 3912c78

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

Source/Plugin_PluginManager/Interface/PanelPluginManager.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,22 @@ void _buttonRemove_Click(object sender, EventArgs e)
9999
MessageBoxType.Error);
100100
if (result == DialogResult.Yes)
101101
{
102-
for (var i = 0; i < items.Count; i++)
103-
{
104-
var item = items[i];
105-
if (item.Checked)
106-
{
107-
var plugin = item.Plugin;
108-
//删除插件所在文件夹
109-
var dirPath = Path.Combine(_host.App.AppPluginDir, plugin.PluginInfo.Name);
110-
if (Directory.Exists(dirPath))
111-
Directory.Delete(dirPath, true);
112-
items.Remove(item);
113-
}
114-
}
115-
_labelMsg.Visible = true;
102+
var delItems = new List<PluginModel>();
103+
foreach (var item in items.Where(r => r.Checked))
104+
{
105+
var plugin = item.Plugin;
106+
//删除插件所在文件夹
107+
var dirPath = Path.Combine(_host.App.AppPluginDir, plugin.PluginInfo.Name);
108+
if (Directory.Exists(dirPath))
109+
Directory.Delete(dirPath, true);
110+
delItems.Add(item);
111+
}
112+
foreach (var item in delItems)
113+
{
114+
items.Remove(item);
115+
}
116+
_gridViewInstalled.DataStore = items;
117+
_labelMsg.Visible = true;
116118
}
117119
}
118120
}

Source/Plugin_PluginManager/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
3333
// 方法是按如下所示使用“*”:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.4.2.0")]
35+
[assembly: AssemblyVersion("1.4.2.1")]

0 commit comments

Comments
 (0)