public static void Start(bool lazyStart = false) { if (lazyStart) { LazyStart = true; YmatouLoggingService.Debug("延迟启动..."); return; } Status = BootstrapperStatus.Starting; var watch = Stopwatch.StartNew(); YmatouLoggingService.Debug("YmatouFramework开始启动...内部版本号:{0}", Version); bootstrapper = new BootstrapperProxy(container); if (bootstrapper.Execute()) { Status = BootstrapperStatus.Started; YmatouLoggingService.Debug("YmatouFramework启动完成!,耗时:{0} 秒...内部版本号:{1}", watch.ElapsedMilliseconds / 1000.0, Version); } else { Status = BootstrapperStatus.FailedToStart; throw new Exception(string.Format("YmatouFramework启动失败!,耗时 {0} 秒 {1}", watch.ElapsedMilliseconds / 1000.0, Version)); } }
public static void Stop() { Status = BootstrapperStatus.Ending; YmatouLoggingService.Debug("YmatouFramework开始清理"); var watch = Stopwatch.StartNew(); bootstrapper.Dispose(); Status = BootstrapperStatus.Ended; YmatouLoggingService.Debug("YmatouFramework清理完成!耗时 :{0}秒 ", watch.ElapsedMilliseconds / 1000.0); }