Files
modernkeepass/ModernKeePass.Infrastructure/DependencyInjection.cs
Geoffroy BONNEVILLE 72e5bf4ee1 Added a cryptography service to encrypt protected information (unused atm)
Corrected a bug when deleting recycle bin
2020-05-14 12:05:05 +02:00

37 lines
1.7 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(IDatabaseSettingsProxy), typeof(KeePassDatabaseSettingsProxy));
services.AddTransient(typeof(ICredentialsProxy), typeof(KeePassCredentialsClient));
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));
services.AddTransient(typeof(IResourceProxy), typeof(UwpResourceClient));
services.AddTransient(typeof(ICryptographyClient), typeof(UwpCryptographyClient));
services.AddTransient(typeof(INotificationService), typeof(ToastNotificationService));
return services;
}
}
}