Skip to content

Commit

Permalink
Fix reload when user want reload all
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Feb 11, 2022
1 parent 98d0a0e commit e98c6aa
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion AddInManager/ViewModel/AddInManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,25 @@ void LoadCommandClick()

void ReloadCommandClick()
{
if (SelectedCommandItem == null)
{
SortedDictionary<string, Addin> Commands = MAddinManagerBase.AddinManager.Commands.AddinDict;
SortedDictionary<string, Addin> OldCommands = new SortedDictionary<string, Addin>(Commands);
foreach (var Command in OldCommands.Values)
{
string fileName = Command.FilePath;
if (File.Exists(fileName)) MAddinManagerBase.AddinManager.LoadAddin(fileName, AssemLoader);
}
MAddinManagerBase.AddinManager.SaveToAimIni();
CommandItems = FreshTreeItems(false, MAddinManagerBase.AddinManager.Commands);
ApplicationItems = FreshTreeItems(false, MAddinManagerBase.AddinManager.Applications);
return;
}
bool flag = MAddinManagerBase.ActiveCmd == null;
if (flag) return;
string path = MAddinManagerBase.ActiveCmd.FilePath;
if (!File.Exists(path)) return;
LoadAssemblyCommand(path);

}
void LoadAssemblyCommand(string fileName)
{
Expand Down

0 comments on commit e98c6aa

Please sign in to comment.