Skip to content

Commit cf735fa

Browse files
committed
Original formatting
1 parent cf1cb18 commit cf735fa

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
using ElectronNET.Runtime.Data;
2-
using ElectronNET.Runtime.Services;
3-
4-
using Microsoft.Extensions.Hosting;
5-
6-
using System.Threading.Tasks;
7-
8-
namespace ElectronNET.AspNet.Runtime;
9-
10-
internal class AspNetLifetimeAdapter : LifetimeServiceBase
1+
namespace ElectronNET.AspNet.Runtime
112
{
12-
private readonly IHostApplicationLifetime lifetimeService;
3+
using System.Threading.Tasks;
4+
using ElectronNET.Runtime.Data;
5+
using ElectronNET.Runtime.Services;
6+
using Microsoft.Extensions.Hosting;
137

14-
public AspNetLifetimeAdapter(IHostApplicationLifetime lifetimeService)
8+
internal class AspNetLifetimeAdapter : LifetimeServiceBase
159
{
16-
this.lifetimeService = lifetimeService;
10+
private readonly IHostApplicationLifetime lifetimeService;
1711

18-
this.lifetimeService.ApplicationStarted.Register(() => this.TransitionState(LifetimeState.Ready));
19-
this.lifetimeService.ApplicationStopping.Register(() => this.TransitionState(LifetimeState.Stopping));
20-
this.lifetimeService.ApplicationStopped.Register(() => this.TransitionState(LifetimeState.Stopped));
21-
}
12+
public AspNetLifetimeAdapter(IHostApplicationLifetime lifetimeService)
13+
{
14+
this.lifetimeService = lifetimeService;
2215

23-
protected override Task StopCore()
24-
{
25-
this.lifetimeService.StopApplication();
26-
return Task.CompletedTask;
16+
this.lifetimeService.ApplicationStarted.Register(() => this.TransitionState(LifetimeState.Ready));
17+
this.lifetimeService.ApplicationStopping.Register(() => this.TransitionState(LifetimeState.Stopping));
18+
this.lifetimeService.ApplicationStopped.Register(() => this.TransitionState(LifetimeState.Stopped));
19+
}
20+
21+
protected override Task StopCore()
22+
{
23+
this.lifetimeService.StopApplication();
24+
return Task.CompletedTask;
25+
}
2726
}
2827
}

0 commit comments

Comments
 (0)