private void OnStopping(ApplicationStoppingEventArgs eventArgs)
 {
     EventHandler<ApplicationStoppingEventArgs> handler = this.Stopping;
     if (handler != null)
     {
         handler(this, eventArgs);
     }
 }
 public void OnStopping(ApplicationStoppingEventArgs e)
 {
     EventHandler<ApplicationStoppingEventArgs> handler = this.Stopping;
     if (handler != null)
     {
         handler(this, e);
     }
 }
        private void OnStopping(ApplicationStoppingEventArgs eventArgs)
        {
            EventHandler <ApplicationStoppingEventArgs> handler = this.Stopping;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        public void StopRaisesStoppingEventWhenWebHostingEnvironmentNotifiesRegisteredObjectsAboutShutdown()
        {
            var service = new WebApplicationLifecycle();

            object stoppingSender = null;
            ApplicationStoppingEventArgs stoppingArgs = null;

            service.Stopping += (sender, args) =>
            {
                stoppingSender = sender;
                stoppingArgs   = args;
            };

            service.Stop(false);

            Assert.IsNotNull(stoppingSender);
            Assert.IsNotNull(stoppingArgs);
        }
 private void HandleApplicationStoppingEvent(object sender, ApplicationStoppingEventArgs e)
 {
     e.Run(this.FlushAsync);
 }
 private void OnStopping(ApplicationStoppingEventArgs eventArgs)
 {
     this.Stopping?.Invoke(this, eventArgs);
 }