Index: Core/Common/src/Core.Common.Base/ApplicationCore.cs =================================================================== diff -u -r48fe36c87dd40ff715adf4c0cf393f7390e6c993 -rc4c3a853502f5248c1feed9281d5e10d2eec25dc --- Core/Common/src/Core.Common.Base/ApplicationCore.cs (.../ApplicationCore.cs) (revision 48fe36c87dd40ff715adf4c0cf393f7390e6c993) +++ Core/Common/src/Core.Common.Base/ApplicationCore.cs (.../ApplicationCore.cs) (revision c4c3a853502f5248c1feed9281d5e10d2eec25dc) @@ -21,8 +21,6 @@ { public class ApplicationCore : IDisposable { - public event Action AfterRun; - // TODO: migrate into ProjectService public event Action ProjectOpening; public event Action ProjectOpened; @@ -31,7 +29,7 @@ public event Action ProjectSaveFailed; public event Action ProjectSaved; - private static readonly ILog log = LogManager.GetLogger(typeof(ApplicationCore)); + private readonly ILog log = LogManager.GetLogger(typeof(ApplicationCore)); public Action WaitMethod; @@ -66,8 +64,6 @@ UserSettings = Properties.Settings.Default; } - public bool IsProjectCreatedInTemporaryDirectory { get; set; } - public Project Project { get @@ -197,9 +193,6 @@ // load all assemblies from current assembly directory AssemblyUtils.LoadAllAssembliesFromDirectory(Path.GetFullPath(Path.GetDirectoryName(GetType().Assembly.Location))).ToList(); - //Disabled trace logging this causes focus bugs combined with avalon dock (KeyPreview debug messages) - //InitializeLogging(); - LogSystemInfo(); Plugins.ForEach(p => p.ApplicationCore = this); @@ -221,11 +214,6 @@ stopwatch.Stop(); log.InfoFormat(Properties.Resources.ApplicationCore_Run_Ringtoets_is_ready_started_in_0_F3_seconds, stopwatch.ElapsedMilliseconds/1000.0); - - if (AfterRun != null) - { - AfterRun(); - } } public void CloseProject() @@ -272,8 +260,6 @@ public void Exit() { - Trace.Listeners.Clear(); - if (Project != null) { CloseProject(); @@ -354,25 +340,14 @@ log.Debug(Properties.Resources.ApplicationCore_ActivatePlugins_All_plugins_were_activated); } - /// - /// Initialize the log4net part - /// - protected static void InitializeLogging() - { - if (!Trace.Listeners.Cast().Any(tl => tl is RingtoetsTraceListener)) - { - Trace.Listeners.Add(new RingtoetsTraceListener()); - } - } - private static Assembly CurrentDomainAssemblyResolve(object sender, ResolveEventArgs args) { //HACK : this is needed because of issue 4382...the black boxes in PG. It seem like the assembly for //enum types like AggregationOptions cannot be found without this return AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.FullName == args.Name); } - private static void LogSystemInfo() + private void LogSystemInfo() { log.DebugFormat(Properties.Resources.ApplicationCore_LogSystemInfo_Environmental_variables_); @@ -429,48 +404,5 @@ { Dispose(false); } - - #region Nested type: RingtoetsTraceListener - - internal class RingtoetsTraceListener : TraceListener - { - private static ILog log; - private static bool logTraceMessages = true; - - public RingtoetsTraceListener() - { - log = LogManager.GetLogger(GetType()); - } - - public static bool LogTraceMessages - { - get - { - return logTraceMessages; - } - set - { - logTraceMessages = value; - } - } - - public override void Write(string message) - { - if (logTraceMessages) - { - WriteLine(message); - } - } - - public override void WriteLine(string message) - { - if (logTraceMessages) - { - log.Debug(message); - } - } - } - - #endregion } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/RingtoetsGui.cs =================================================================== diff -u -r48fe36c87dd40ff715adf4c0cf393f7390e6c993 -rc4c3a853502f5248c1feed9281d5e10d2eec25dc --- Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision 48fe36c87dd40ff715adf4c0cf393f7390e6c993) +++ Core/Common/src/Core.Common.Gui/RingtoetsGui.cs (.../RingtoetsGui.cs) (revision c4c3a853502f5248c1feed9281d5e10d2eec25dc) @@ -72,13 +72,8 @@ instanceCreationStackTrace = new StackTrace().ToString(); ViewPropertyEditor.Gui = this; - ApplicationCore = new ApplicationCore - { - IsProjectCreatedInTemporaryDirectory = true, - WaitMethod = () => System.Windows.Forms.Application.DoEvents() - }; - Plugins = new List(); + ApplicationCore = new ApplicationCore(); applicationCore.UserSettings = Settings.Default; applicationCore.Settings = ConfigurationManager.AppSettings;