Admin mode WIP

This commit is contained in:
2023-07-26 10:24:22 +02:00
parent ba1210b2c4
commit 0c49071a3b
46 changed files with 695 additions and 55 deletions

View File

@@ -12,6 +12,9 @@ using FileTime.Core.ContentAccess;
using FileTime.Core.Services;
using FileTime.Core.Timeline;
using FileTime.Providers.Local;
using FileTime.Providers.LocalAdmin;
using FileTime.Providers.Remote;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
@@ -19,7 +22,7 @@ namespace FileTime.App.DependencyInjection;
public static class DependencyInjection
{
public static IServiceCollection RegisterDefaultServices(IServiceCollection? serviceCollection = null)
public static IServiceCollection RegisterDefaultServices(IConfigurationRoot configuration, IServiceCollection? serviceCollection = null)
{
serviceCollection ??= new ServiceCollection();
@@ -31,7 +34,7 @@ public static class DependencyInjection
//TODO: check local/remote context
serviceCollection.TryAddSingleton<ILocalCommandExecutor, LocalCommandExecutor>();
serviceCollection.TryAddSingleton<ICommandSchedulerNotifier, LocalCommandSchedulerNotifier>();
serviceCollection.TryAddSingleton<IApplicationSettings, ApplicationSettings>();
serviceCollection.TryAddSingleton<ITabPersistenceService, TabPersistenceService>();
serviceCollection.TryAddTransient<ITab, Tab>();
@@ -41,18 +44,18 @@ public static class DependencyInjection
return serviceCollection
.AddCoreAppServices()
.AddLocalServices()
.AddLocalProviderServices()
.AddLocalAdminProviderServices(configuration)
.AddRemoteProviderServices()
.RegisterCommands()
.AddDefaultCommandHandlers();
}
private static IServiceCollection RegisterCommands(this IServiceCollection serviceCollection)
{
return serviceCollection
=> serviceCollection
.AddCommands()
.AddTransient<CreateContainerCommand>()
.AddTransient<CreateElementCommand>()
.AddTransient<CopyCommand>()
.AddTransient<DeleteCommand>();
}
}

View File

@@ -16,6 +16,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Core\FileTime.Core.CommandHandlers\FileTime.Core.CommandHandlers.csproj" />
<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="..\FileTime.App.Core\FileTime.App.Core.csproj" />
</ItemGroup>