Пример #1
0
 protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
 {
     base.OnClosing(e);
     try
     {
         SaveLayout();
         PublicTransport.ApplicationEventBus.PublishWait(new ShutdownEvent());
         ExeConfig.Save();
     }
     catch (Exception ex)
     {
         if (null == Logger)
         {
             return;
         }
         Logger.Log(LogLevel.Error, this, ex.ToString());
     }
 }
Пример #2
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Application.Exit" /> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.Windows.ExitEventArgs" /> that contains the event data.</param>
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     if (shutdownOnEvent)
     {
         return;
     }
     if (null == publicTransport)
     {
         return;
     }
     if (null == publicTransport.ApplicationEventBus)
     {
         logger.Log(LogLevel.Error, this, "Cannot find Event bus to notify application shutdown");
         return;
     }
     publicTransport.ApplicationEventBus.PublishWait(new ShutdownEvent());
     ExeConfig.Save();
 }
Пример #3
0
 private void OnShutdown(ShutdownEvent shutdownEvent)
 {
     shutdownOnEvent = true;
     Shutdown();
     ExeConfig.Save();
 }