Index: Core/Common/src/Core.Common.Base/DeltaShellApplication.cs =================================================================== diff -u -r5bf7162daa83726f44ab976d48057fdae2f88d0a -r98b397912e4e949b1f518a8a830d8a35ac464968 --- Core/Common/src/Core.Common.Base/DeltaShellApplication.cs (.../DeltaShellApplication.cs) (revision 5bf7162daa83726f44ab976d48057fdae2f88d0a) +++ Core/Common/src/Core.Common.Base/DeltaShellApplication.cs (.../DeltaShellApplication.cs) (revision 98b397912e4e949b1f518a8a830d8a35ac464968) @@ -345,7 +345,7 @@ GC.SuppressFinalize(this); } - protected void ActivatePlugins() + private void ActivatePlugins() { log.Debug(Properties.Resources.DeltaShellApplication_Run_Activating_plugins____); Index: Core/Common/src/Core.Common.Gui/DeltaShellGui.cs =================================================================== diff -u -rffdd49e6f65bada7314bb033383dd56f70048762 -r98b397912e4e949b1f518a8a830d8a35ac464968 --- Core/Common/src/Core.Common.Gui/DeltaShellGui.cs (.../DeltaShellGui.cs) (revision ffdd49e6f65bada7314bb033383dd56f70048762) +++ Core/Common/src/Core.Common.Gui/DeltaShellGui.cs (.../DeltaShellGui.cs) (revision 98b397912e4e949b1f518a8a830d8a35ac464968) @@ -51,7 +51,6 @@ private ViewList toolWindowViews; private AvalonDockDockingManager toolWindowViewsDockingManager; - private readonly IList dropTargetPluginGuis = new List(); private readonly IList commands = new List(); private SplashScreen splashScreen; @@ -375,12 +374,11 @@ if (Plugins != null) { - dropTargetPluginGuis.Clear(); - foreach (var plugin in Plugins) + foreach (var plugin in Plugins.ToList()) { - plugin.Deactivate(); - plugin.Dispose(); + DeactivatePlugin(plugin); } + Plugins = null; } @@ -506,6 +504,22 @@ instance = null; } + private void DeactivatePlugin(GuiPlugin plugin) + { + try + { + plugin.Deactivate(); + } + catch (Exception exception) + { + log.Error(Resources.DeltaShellGui_ActivatePlugins_Exception_during_plugin_gui_deactivation, exception); + } + + plugin.Dispose(); + + Plugins.Remove(plugin); + } + private void ApplicationProjectSaved(Project obj) { ResumeUI(); @@ -948,6 +962,8 @@ var problematicPlugins = new List(); mainWindow.SuspendLayout(); + + // Try to activate all plugins foreach (var plugin in Plugins) { try @@ -960,28 +976,10 @@ } } - // remove problematic plugins - for (int i = 0; i < problematicPlugins.Count; i++) + // Deactivate and remove all problematic plugins + foreach (var problematicPlugin in problematicPlugins) { - try - { - problematicPlugins[i].Deactivate(); - } - catch (Exception exception) - { - log.Error(Resources.DeltaShellGui_ActivatePlugins_Exception_during_plugin_gui_deactivation, exception); - } - - try - { - problematicPlugins[i].Deactivate(); - } - catch (Exception exception) - { - log.Error(Resources.DeltaShellGui_ActivatePlugins_Exception_during_plugin_deactivation, exception); - } - - Plugins.Remove(problematicPlugins[i]); + DeactivatePlugin(problematicPlugin); } mainWindow.ResumeLayout(); Index: Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs =================================================================== diff -u -rc921a50a3d1e0e6bfceff4fdff0b27705825af11 -r98b397912e4e949b1f518a8a830d8a35ac464968 --- Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c921a50a3d1e0e6bfceff4fdff0b27705825af11) +++ Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 98b397912e4e949b1f518a8a830d8a35ac464968) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.18063 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -742,15 +742,6 @@ } /// - /// Looks up a localized string similar to Exception during plugin deactivation. - /// - public static string DeltaShellGui_ActivatePlugins_Exception_during_plugin_deactivation { - get { - return ResourceManager.GetString("DeltaShellGui_ActivatePlugins_Exception_during_plugin_deactivation", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Exception during plugin gui deactivation. /// public static string DeltaShellGui_ActivatePlugins_Exception_during_plugin_gui_deactivation { Index: Core/Common/src/Core.Common.Gui/Properties/Resources.nl-NL.resx =================================================================== diff -u -reee6c7815d1e418eac38c1c552fb279c0887ef55 -r98b397912e4e949b1f518a8a830d8a35ac464968 --- Core/Common/src/Core.Common.Gui/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision eee6c7815d1e418eac38c1c552fb279c0887ef55) +++ Core/Common/src/Core.Common.Gui/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 98b397912e4e949b1f518a8a830d8a35ac464968) @@ -273,9 +273,6 @@ NL Error during plugin activation - - NL Exception during plugin deactivation - NL Exception during plugin gui deactivation Index: Core/Common/src/Core.Common.Gui/Properties/Resources.resx =================================================================== diff -u -rc921a50a3d1e0e6bfceff4fdff0b27705825af11 -r98b397912e4e949b1f518a8a830d8a35ac464968 --- Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision c921a50a3d1e0e6bfceff4fdff0b27705825af11) +++ Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision 98b397912e4e949b1f518a8a830d8a35ac464968) @@ -362,9 +362,6 @@ Starting application ... - - Exception during plugin deactivation - Export failed