Beispiel #1
0
        public void Stop()
        {
            Logger.Info("Application is stopping...");
            SequenceExecutor.For(_services)
            .IgnoreErrors()
            .Execute(x => x.Stop());

            SequenceExecutor.For(_resources)
            .IgnoreErrors()
            .Execute(x => x.Dispose());

            Logger.Info("Application is stopped");
        }
Beispiel #2
0
        private void StartCore()
        {
            IStartupSettings startupSettings = new AppStartupSettings();

            _resources = GetResources();
            SequenceExecutor.For(_resources)
            .RallbackOnError(x => x.Dispose())
            .Execute(x => x.Load(startupSettings));

            _services = GetServices();
            SequenceExecutor.For(_services)
            .RallbackOnError(x => x.Stop())
            .Execute(x => x.Start(startupSettings));
        }