/// <summary>Performs the shutdown of the application. Notifies all components and modules about pending application shutdown. /// </summary> public virtual void Shutdown() { ActivationLog.WriteMessage("Shutting down app {0}. =======================\r\n\r\n", AppName); Flush(); if (_shutdownTokenSource != null) { _shutdownTokenSource.Cancel(); Task.Yield(); } Status = EntityAppStatus.Shutdown; foreach (var module in this.Modules) { module.Shutdown(); } //shutdown services var servList = this.GetAllServices(); for (int i = 0; i < servList.Count; i++) { var service = servList[i]; var iEntService = service as IEntityServiceBase; if (iEntService != null) { iEntService.Shutdown(); } } if (this.LogFileWriter != null) { } AppEvents.OnShutdown(); }
/// <summary>Performs the shutdown of the application. Notifies all components and modules about pending application shutdown. /// </summary> public virtual void Shutdown() { SystemLog.Info("Shutting down app {0}.", AppName); Flush(); Status = EntityAppStatus.Shutdown; foreach (var module in this.Modules) { module.Shutdown(); } //shutdown services var servList = this.GetAllServices(); for (int i = 0; i < servList.Count; i++) { var service = servList[i]; var iEntService = service as IEntityService; if (iEntService != null) { iEntService.Shutdown(); } } AppEvents.OnShutdown(); System.Threading.Thread.Sleep(100); }