Index: Core/Gui/src/Core.Gui/GuiCore.cs
===================================================================
diff -u -re848b504d265b0c9443afc069a3b31227af46409 -r3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153
--- Core/Gui/src/Core.Gui/GuiCore.cs (.../GuiCore.cs) (revision e848b504d265b0c9443afc069a3b31227af46409)
+++ Core/Gui/src/Core.Gui/GuiCore.cs (.../GuiCore.cs) (revision 3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153)
@@ -23,7 +23,6 @@
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
@@ -61,9 +60,6 @@
{
private static readonly ILog log = LogManager.GetLogger(typeof(GuiCore));
- private static bool isAlreadyRunningInstanceOfIGui;
- private static string instanceCreationStackTrace;
-
private readonly string applicationTitle;
private readonly Observer projectObserver;
private ISelectionProvider currentSelectionProvider;
@@ -78,21 +74,9 @@
/// The project migrator.
/// The project factory.
/// The fixed settings.
- /// Thrown when another
- /// instance is running.
/// Thrown when any parameter is null.
public GuiCore(IMainWindow mainWindow, IStoreProject projectStore, IMigrateProject projectMigrator, IProjectFactory projectFactory, GuiCoreSettings fixedSettings)
{
- // Error detection code, make sure we use only a single instance of GuiCore at a time
- if (isAlreadyRunningInstanceOfIGui)
- {
- isAlreadyRunningInstanceOfIGui = false; // Reset so that the consecutive creations won't fail
- throw new InvalidOperationException(
- string.Format(CultureInfo.CurrentCulture,
- Resources.GuiCore_Only_a_single_instance_is_allowed_at_the_same_time_per_process_Make_sure_that_the_previous_instance_was_disposed_correctly_stack_trace_0,
- instanceCreationStackTrace));
- }
-
if (mainWindow == null)
{
throw new ArgumentNullException(nameof(mainWindow));
@@ -122,9 +106,6 @@
FixedSettings = fixedSettings;
MainWindow = mainWindow;
- isAlreadyRunningInstanceOfIGui = true;
- instanceCreationStackTrace = new StackTrace().ToString();
-
Plugins = new List();
viewCommandHandler = new ViewCommandHandler(this, this, this);
@@ -328,9 +309,6 @@
#endregion
GC.Collect();
-
- instanceCreationStackTrace = "";
- isAlreadyRunningInstanceOfIGui = false;
}
private void DeactivatePlugin(PluginBase plugin)
Index: Core/Gui/src/Core.Gui/Properties/Resources.Designer.cs
===================================================================
diff -u -re848b504d265b0c9443afc069a3b31227af46409 -r3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153
--- Core/Gui/src/Core.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e848b504d265b0c9443afc069a3b31227af46409)
+++ Core/Gui/src/Core.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153)
@@ -1246,16 +1246,6 @@
}
///
- /// Looks up a localized string similar to Slechts één instantie van de grafische interface is toegestaan per proces. Zorg ervoor dat de vorige instantie correct opgeruimd is. 'Stack trace': {0}.
- ///
- public static string GuiCore_Only_a_single_instance_is_allowed_at_the_same_time_per_process_Make_sure_that_the_previous_instance_was_disposed_correctly_stack_trace_0 {
- get {
- return ResourceManager.GetString("GuiCore_Only_a_single_instance_is_allowed_at_the_same_time_per_process_Make_sure_" +
- "that_the_previous_instance_was_disposed_correctly_stack_trace_0", resourceCulture);
- }
- }
-
- ///
/// Looks up a localized string similar to Gestart in {0:f2} seconden..
///
public static string GuiCore_Run_Started_in_0_f2_sec {
Index: Core/Gui/src/Core.Gui/Properties/Resources.resx
===================================================================
diff -u -re848b504d265b0c9443afc069a3b31227af46409 -r3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153
--- Core/Gui/src/Core.Gui/Properties/Resources.resx (.../Resources.resx) (revision e848b504d265b0c9443afc069a3b31227af46409)
+++ Core/Gui/src/Core.Gui/Properties/Resources.resx (.../Resources.resx) (revision 3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153)
@@ -223,9 +223,6 @@
..\Resources\information.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- Slechts één instantie van de grafische interface is toegestaan per proces. Zorg ervoor dat de vorige instantie correct opgeruimd is. 'Stack trace': {0}
-
Berichten
Index: Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs
===================================================================
diff -u -r5f736cce56b144cb9d28cbc85efd738b9a90a725 -r3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153
--- Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 5f736cce56b144cb9d28cbc85efd738b9a90a725)
+++ Core/Gui/test/Core.Gui.Test/GuiCoreTest.cs (.../GuiCoreTest.cs) (revision 3ea7b672d4425d0fa1c7edd7ab7b92e7e2ea0153)
@@ -242,34 +242,6 @@
}
[Test]
- public void Constructor_ConstructedAfterAnotherInstanceHasBeenCreated_ThrowsInvalidOperationException()
- {
- // Setup
- var mocks = new MockRepository();
- var projectStore = mocks.Stub();
- var projectMigrator = mocks.Stub();
- var projectFactory = mocks.Stub();
- mocks.ReplayAll();
-
- var guiCoreSettings = new GuiCoreSettings();
-
- using (var mainWindow = new MainWindow())
- using (new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, guiCoreSettings))
- {
- // Call
- void Call()
- {
- using (new GuiCore(mainWindow, projectStore, projectMigrator, projectFactory, guiCoreSettings)) {}
- }
-
- // Assert
- Assert.Throws(Call);
- }
-
- mocks.VerifyAll();
- }
-
- [Test]
public void Dispose_WithPlugin_PluginRemoved()
{
// Setup