mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using ModernKeePass.Application.Common.Interfaces;
|
|
using ModernKeePass.Domain.Interfaces;
|
|
using ModernKeePass.Infrastructure.Common;
|
|
using ModernKeePass.Infrastructure.KeePass;
|
|
using ModernKeePass.Infrastructure.UWP;
|
|
|
|
namespace ModernKeePass.Infrastructure
|
|
{
|
|
public static class DependencyInjection
|
|
{
|
|
public static IServiceCollection AddInfrastructureCommon(this IServiceCollection services)
|
|
{
|
|
services.AddTransient(typeof(IDateTime), typeof(MachineDateTime));
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddInfrastructureKeePass(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton(typeof(IDatabaseProxy), typeof(KeePassDatabaseClient));
|
|
services.AddTransient(typeof(ICryptographyClient), typeof(KeePassCryptographyClient));
|
|
services.AddTransient(typeof(IPasswordProxy), typeof(KeePassPasswordClient));
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddInfrastructureUwp(this IServiceCollection services)
|
|
{
|
|
services.AddScoped(typeof(IFileProxy), typeof(StorageFileClient));
|
|
services.AddTransient(typeof(ISettingsProxy), typeof(UwpSettingsClient));
|
|
services.AddTransient(typeof(IRecentProxy), typeof(UwpRecentFilesClient));
|
|
return services;
|
|
}
|
|
}
|
|
} |