Index: Core/Common/src/Core.Common.Base/ApplicationCore.cs =================================================================== diff -u -rd2a39de92e27154e52caeffdae182c937bc1fcb2 -r329979bc2494f0ddf111ef8c1c2801f4c9302962 --- Core/Common/src/Core.Common.Base/ApplicationCore.cs (.../ApplicationCore.cs) (revision d2a39de92e27154e52caeffdae182c937bc1fcb2) +++ Core/Common/src/Core.Common.Base/ApplicationCore.cs (.../ApplicationCore.cs) (revision 329979bc2494f0ddf111ef8c1c2801f4c9302962) @@ -1,14 +1,11 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Configuration; -using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Resources; -using System.Threading; using Core.Common.Base.Workflow; using Core.Common.Utils; using Core.Common.Utils.Aop; @@ -40,9 +37,6 @@ private bool running; - private Project projectBeingCreated; - private bool initializing; - private bool disposed; public ApplicationCore() @@ -178,28 +172,20 @@ isRunning = true; - initializing = true; - log.Info(Properties.Resources.ApplicationCore_Run_starting); // load all assemblies from current assembly directory AssemblyUtils.LoadAllAssembliesFromDirectory(Path.GetFullPath(Path.GetDirectoryName(GetType().Assembly.Location))).ToList(); - LogSystemInfo(); - Plugins.ForEach(p => p.ApplicationCore = this); - log.Info(Properties.Resources.ApplicationCore_Run_Creating_new_project); - CreateNewProject(); - log.Info(Properties.Resources.ApplicationCore_Run_Activating_plugins); ActivatePlugins(); log.Info(Properties.Resources.ApplicationCore_Run_Waiting_until_all_plugins_are_activated); - Project = projectBeingCreated; // opens project in application - - initializing = false; + log.Info(Properties.Resources.ApplicationCore_Run_Creating_new_project); + Project = new Project(); } public void CloseProject() @@ -217,21 +203,6 @@ // TODO: implement } - public void CreateNewProject() - { - if (!isRunning) - { - throw new InvalidOperationException(Properties.Resources.ApplicationCore_CreateNewProject_Run_must_be_called_first_before_project_can_be_opened); - } - - projectBeingCreated = new Project(); - - if (!initializing) // open in app - { - Project = projectBeingCreated; - } - } - public bool OpenProject(string path) { if (!isRunning) @@ -333,25 +304,6 @@ return AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.FullName == args.Name); } - private void LogSystemInfo() - { - log.DebugFormat(Properties.Resources.ApplicationCore_LogSystemInfo_Environmental_variables_); - - var culture = Thread.CurrentThread.CurrentCulture; - log.DebugFormat("{0} = {1}", "CURRENT_THREAD_CULTURE", culture.EnglishName); - log.DebugFormat("{0} = {1}", "NUMBER_DECIMAL_DIGITS", culture.NumberFormat.NumberDecimalDigits); - log.DebugFormat("{0} = {1}", "NUMBER_DECIMAL_SEPARATOR", culture.NumberFormat.NumberDecimalSeparator); - log.DebugFormat("{0} = {1}", "FULL_DATE_TIME_PATTERN", culture.DateTimeFormat.FullDateTimePattern); - log.DebugFormat("{0} = {1}", "DATE_SEPARATOR", culture.DateTimeFormat.DateSeparator); - log.DebugFormat("{0} = {1}", "OS_VERSION", Environment.OSVersion); - log.DebugFormat("{0} = {1}", "OS_VERSION_NUMBER", Environment.Version); - - foreach (DictionaryEntry pair in Environment.GetEnvironmentVariables()) - { - log.DebugFormat("{0} = {1}", pair.Key, pair.Value); - } - } - private void Dispose(bool disposing) { if (!disposed) @@ -360,8 +312,6 @@ { CloseProject(); - projectBeingCreated = null; - foreach (var plugin in Plugins) { plugin.Deactivate(); Index: Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs =================================================================== diff -u -rd2a39de92e27154e52caeffdae182c937bc1fcb2 -r329979bc2494f0ddf111ef8c1c2801f4c9302962 --- Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d2a39de92e27154e52caeffdae182c937bc1fcb2) +++ Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 329979bc2494f0ddf111ef8c1c2801f4c9302962) @@ -198,15 +198,6 @@ } /// - /// Looks up a localized string similar to Omgevingsvariabelen:. - /// - internal static string ApplicationCore_LogSystemInfo_Environmental_variables_ { - get { - return ResourceManager.GetString("ApplicationCore_LogSystemInfo_Environmental_variables_", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Activeer plugins.... /// internal static string ApplicationCore_Run_Activating_plugins { Index: Core/Common/src/Core.Common.Base/Properties/Resources.resx =================================================================== diff -u -rd2a39de92e27154e52caeffdae182c937bc1fcb2 -r329979bc2494f0ddf111ef8c1c2801f4c9302962 --- Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision d2a39de92e27154e52caeffdae182c937bc1fcb2) +++ Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision 329979bc2494f0ddf111ef8c1c2801f4c9302962) @@ -135,9 +135,6 @@ 'Run()' moet eerst worden aangeroepen voordat het project kan worden geopend. - - Omgevingsvariabelen: - Alle plugins zijn geactiveerd. Index: Core/Common/src/Core.Common.Gui/GuiCommandHandler.cs =================================================================== diff -u -r48fe36c87dd40ff715adf4c0cf393f7390e6c993 -r329979bc2494f0ddf111ef8c1c2801f4c9302962 --- Core/Common/src/Core.Common.Gui/GuiCommandHandler.cs (.../GuiCommandHandler.cs) (revision 48fe36c87dd40ff715adf4c0cf393f7390e6c993) +++ Core/Common/src/Core.Common.Gui/GuiCommandHandler.cs (.../GuiCommandHandler.cs) (revision 329979bc2494f0ddf111ef8c1c2801f4c9302962) @@ -50,7 +50,7 @@ } Log.Info(Resources.Opening_new_project); - gui.ApplicationCore.CreateNewProject(); + gui.ApplicationCore.Project = new Project(); Log.Info(Resources.New_project_successfully_opened); RefreshGui(); Index: Core/Common/test/Core.Common.Integration.Tests/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs =================================================================== diff -u -r48fe36c87dd40ff715adf4c0cf393f7390e6c993 -r329979bc2494f0ddf111ef8c1c2801f4c9302962 --- Core/Common/test/Core.Common.Integration.Tests/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs (.../RingtoetsGuiIntegrationTest.cs) (revision 48fe36c87dd40ff715adf4c0cf393f7390e6c993) +++ Core/Common/test/Core.Common.Integration.Tests/Ringtoets/Application.Ringtoets/RingtoetsGuiIntegrationTest.cs (.../RingtoetsGuiIntegrationTest.cs) (revision 329979bc2494f0ddf111ef8c1c2801f4c9302962) @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Threading; +using Core.Common.Base; using Core.Common.Base.Workflow; using Core.Common.Gui; using Core.Common.TestUtils; @@ -143,7 +144,7 @@ gui.Run(); - Action onShown = () => TestHelper.AssertIsFasterThan(300, gui.ApplicationCore.CreateNewProject); + Action onShown = () => TestHelper.AssertIsFasterThan(300, () => gui.ApplicationCore.Project = new Project()); WpfTestHelper.ShowModal((Control) gui.MainWindow, onShown); }