Browse ISOs
This commit is contained in:
@@ -28,7 +28,7 @@ public class ContainerSizeSizeScanProvider : ContentProviderBase, IContainerSize
|
||||
PointInTime pointInTime,
|
||||
bool forceResolve = false,
|
||||
AbsolutePathType forceResolvePathType = AbsolutePathType.Unknown,
|
||||
ItemInitializationSettings itemInitializationSettings = null
|
||||
ItemInitializationSettings itemInitializationSettings = default
|
||||
)
|
||||
{
|
||||
if (fullName.Path == ContentProviderName)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace FileTime.App.Core.Services;
|
||||
|
||||
public interface IPreStartupHandler
|
||||
{
|
||||
Task InitAsync();
|
||||
}
|
||||
@@ -5,15 +5,18 @@ namespace FileTime.App.Core.Services;
|
||||
|
||||
public class LifecycleService : ILifecycleService
|
||||
{
|
||||
private readonly IEnumerable<IPreStartupHandler> _preStartupHandlers;
|
||||
private readonly IEnumerable<IExitHandler> _exitHandlers;
|
||||
private readonly IEnumerable<IStartupHandler> _startupHandlers;
|
||||
private readonly ILogger<LifecycleService> _logger;
|
||||
|
||||
public LifecycleService(
|
||||
IEnumerable<IPreStartupHandler> preStartupHandlers,
|
||||
IEnumerable<IStartupHandler> startupHandlers,
|
||||
IEnumerable<IExitHandler> exitHandlers,
|
||||
ILogger<LifecycleService> logger)
|
||||
{
|
||||
_preStartupHandlers = preStartupHandlers;
|
||||
_exitHandlers = exitHandlers;
|
||||
_startupHandlers = startupHandlers;
|
||||
_logger = logger;
|
||||
@@ -21,6 +24,18 @@ public class LifecycleService : ILifecycleService
|
||||
|
||||
public async Task InitStartupHandlersAsync()
|
||||
{
|
||||
foreach (var preStartupHandler in _preStartupHandlers)
|
||||
{
|
||||
try
|
||||
{
|
||||
await preStartupHandler.InitAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error while running pre-startup handler {Handler}", preStartupHandler.GetType().FullName);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var startupHandler in _startupHandlers)
|
||||
{
|
||||
try
|
||||
@@ -29,7 +44,7 @@ public class LifecycleService : ILifecycleService
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error while running startup handler {Handler}", startupHandler?.GetType().FullName);
|
||||
_logger.LogError(ex, "Error while running startup handler {Handler}", startupHandler.GetType().FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using FileTime.App.Core.Models.Enums;
|
||||
using FileTime.App.Core.UserCommand;
|
||||
using FileTime.App.Core.ViewModels;
|
||||
using FileTime.App.FrequencyNavigation.Services;
|
||||
using FileTime.Core.ContentAccess;
|
||||
using FileTime.Core.Interactions;
|
||||
using FileTime.Core.Models;
|
||||
using FileTime.Core.Services;
|
||||
@@ -29,6 +30,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
|
||||
private readonly IUserCommunicationService _userCommunicationService;
|
||||
private readonly IFrequencyNavigationService _frequencyNavigationService;
|
||||
private readonly ICommandPaletteService _commandPaletteService;
|
||||
private readonly IContentProviderRegistry _contentProviderRegistry;
|
||||
private readonly ILogger<NavigationUserCommandHandlerService> _logger;
|
||||
private readonly ApplicationConfiguration _applicationConfiguration;
|
||||
private ITabViewModel? _selectedTab;
|
||||
@@ -46,6 +48,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
|
||||
IUserCommunicationService userCommunicationService,
|
||||
IFrequencyNavigationService frequencyNavigationService,
|
||||
ICommandPaletteService commandPaletteService,
|
||||
IContentProviderRegistry contentProviderRegistry,
|
||||
ILogger<NavigationUserCommandHandlerService> logger,
|
||||
ApplicationConfiguration applicationConfiguration) : base(appState)
|
||||
{
|
||||
@@ -57,6 +60,7 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
|
||||
_userCommunicationService = userCommunicationService;
|
||||
_frequencyNavigationService = frequencyNavigationService;
|
||||
_commandPaletteService = commandPaletteService;
|
||||
_contentProviderRegistry = contentProviderRegistry;
|
||||
_logger = logger;
|
||||
_applicationConfiguration = applicationConfiguration;
|
||||
|
||||
@@ -249,13 +253,40 @@ public class NavigationUserCommandHandlerService : UserCommandHandlerServiceBase
|
||||
|
||||
private async Task OpenSelected()
|
||||
{
|
||||
if (_currentSelectedItem?.Value is not IContainerViewModel containerViewModel || containerViewModel.Container is null)
|
||||
var targetContainer = await GetSubContainer();
|
||||
|
||||
if (targetContainer is null
|
||||
&& _currentSelectedItem?.Value is IContainerViewModel {Container: { } container})
|
||||
{
|
||||
targetContainer = container;
|
||||
}
|
||||
|
||||
if (targetContainer is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
await _appState.SetRapidTravelTextAsync("");
|
||||
if (_selectedTab?.Tab is { } tab)
|
||||
{
|
||||
await tab.SetCurrentLocation(containerViewModel.Container);
|
||||
await tab.SetCurrentLocation(targetContainer);
|
||||
}
|
||||
|
||||
async Task<IContainer?> GetSubContainer()
|
||||
{
|
||||
if (_currentSelectedItem?.Value is not {BaseItem: IElement element})
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var subContentProvider = await _contentProviderRegistry.GetSubContentProviderForElement(element);
|
||||
if (subContentProvider is null) return null;
|
||||
|
||||
var resolvedItem = await subContentProvider.GetItemByFullNameAsync(
|
||||
element,
|
||||
new FullName(""),
|
||||
_timelessContentProvider.CurrentPointInTime.Value!);
|
||||
return resolvedItem as IContainer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,9 @@ public partial class TabViewModel : ITabViewModel
|
||||
|
||||
private static IItem MapItem(AbsolutePath item)
|
||||
{
|
||||
var t = Task.Run(async () => await MapItemAsync(item));
|
||||
var t = Task.Run(async () =>
|
||||
await MapItemAsync(item)
|
||||
?? throw new Exception("Could not resolve path " + item.Path.Path));
|
||||
t.Wait();
|
||||
return t.Result;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using FileTime.Core;
|
||||
using FileTime.Providers.Local;
|
||||
using FileTime.Providers.LocalAdmin;
|
||||
using FileTime.Providers.Remote;
|
||||
using FileTime.Tools.VirtualDiskSources;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
@@ -28,6 +29,7 @@ public static class DependencyInjection
|
||||
.AddAppCoreDependencies(configuration)
|
||||
.AddLocalProviderServices()
|
||||
.AddLocalAdminProviderServices(configuration)
|
||||
.AddRemoteProviderServices();
|
||||
.AddRemoteProviderServices()
|
||||
.AddVirtualDisk();
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@
|
||||
<ProjectReference Include="..\..\Core\FileTime.Core.Timeline\FileTime.Core.Timeline.csproj" />
|
||||
<ProjectReference Include="..\..\Providers\FileTime.Providers.LocalAdmin\FileTime.Providers.LocalAdmin.csproj" />
|
||||
<ProjectReference Include="..\..\Providers\FileTime.Providers.Local\FileTime.Providers.Local.csproj" />
|
||||
<ProjectReference Include="..\..\Tools\FileTime.Tools.VirtualDiskSources\FileTime.Tools.VirtualDiskSources.csproj" />
|
||||
<ProjectReference Include="..\FileTime.App.Core\FileTime.App.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SearchContentProvider : ContentProviderBase, ISearchContentProvider
|
||||
PointInTime pointInTime,
|
||||
bool forceResolve = false,
|
||||
AbsolutePathType forceResolvePathType = AbsolutePathType.Unknown,
|
||||
ItemInitializationSettings itemInitializationSettings = null
|
||||
ItemInitializationSettings itemInitializationSettings = default
|
||||
)
|
||||
{
|
||||
if (fullName.Path == ContentProviderName)
|
||||
|
||||
Reference in New Issue
Block a user