Tab restore
This commit is contained in:
@@ -5,13 +5,23 @@ namespace FileTime.GuiApp.Services;
|
||||
public class LifecycleService
|
||||
{
|
||||
private readonly IEnumerable<IExitHandler> _exitHandlers;
|
||||
private readonly IEnumerable<IStartupHandler> _startupHandlers;
|
||||
|
||||
public LifecycleService(IEnumerable<IStartupHandler> startupHandlers, IEnumerable<IExitHandler> exitHandlers)
|
||||
{
|
||||
_exitHandlers = exitHandlers;
|
||||
_startupHandlers = startupHandlers;
|
||||
}
|
||||
|
||||
public async Task Exit()
|
||||
public async Task InitStartupHandlersAsync()
|
||||
{
|
||||
foreach (var startupHandler in _startupHandlers)
|
||||
{
|
||||
await startupHandler.InitAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ExitAsync()
|
||||
{
|
||||
foreach (var exitHandler in _exitHandlers)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ public class RootDriveInfoService : IStartupHandler
|
||||
{
|
||||
var containerPath = localContentProvider.GetNativePath(i.Path).Path;
|
||||
var drivePath = d.Name.TrimEnd(Path.DirectorySeparatorChar);
|
||||
return containerPath == drivePath
|
||||
return containerPath == drivePath
|
||||
|| (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && containerPath == "/" && d.Name == "/");
|
||||
})))
|
||||
.Filter(t => t.Drive is not null);
|
||||
@@ -68,4 +68,6 @@ public class RootDriveInfoService : IStartupHandler
|
||||
_rootDrives.AddRange(drives);
|
||||
}
|
||||
}
|
||||
|
||||
public Task InitAsync() => Task.CompletedTask;
|
||||
}
|
||||
Reference in New Issue
Block a user