2024-04-18 01:44:37 +02:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using Serilog.Core;
|
2024-07-21 05:45:02 +02:00
|
|
|
|
using Wino.Domain.Interfaces;
|
|
|
|
|
|
using Wino.Services.Authenticators;
|
|
|
|
|
|
using Wino.Services.Processors;
|
|
|
|
|
|
using Wino.Services.Services;
|
|
|
|
|
|
using Wino.Services.Threading;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2024-07-21 05:45:02 +02:00
|
|
|
|
namespace Wino.Services
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2024-07-21 05:45:02 +02:00
|
|
|
|
public static class ServicesContainerSetup
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2024-07-21 05:45:02 +02:00
|
|
|
|
public static void RegisterServices(this IServiceCollection services)
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
|
|
|
|
|
var loggerLevelSwitcher = new LoggingLevelSwitch();
|
|
|
|
|
|
|
|
|
|
|
|
services.AddSingleton(loggerLevelSwitcher);
|
|
|
|
|
|
services.AddSingleton<ILogInitializer, LogInitializer>();
|
|
|
|
|
|
|
2024-07-18 20:03:58 +02:00
|
|
|
|
services.AddSingleton<IApplicationConfiguration, ApplicationConfiguration>();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
services.AddSingleton<ITranslationService, TranslationService>();
|
|
|
|
|
|
services.AddSingleton<IDatabaseService, DatabaseService>();
|
|
|
|
|
|
services.AddSingleton<IThreadingStrategyProvider, ThreadingStrategyProvider>();
|
|
|
|
|
|
services.AddSingleton<IMimeFileService, MimeFileService>();
|
|
|
|
|
|
|
|
|
|
|
|
services.AddTransient<ITokenService, TokenService>();
|
|
|
|
|
|
services.AddTransient<IProviderService, ProviderService>();
|
|
|
|
|
|
services.AddTransient<IFolderService, FolderService>();
|
|
|
|
|
|
services.AddTransient<IMailService, MailService>();
|
|
|
|
|
|
services.AddTransient<IAccountService, AccountService>();
|
|
|
|
|
|
services.AddTransient<IContactService, ContactService>();
|
|
|
|
|
|
services.AddTransient<ISignatureService, SignatureService>();
|
2024-07-21 05:45:02 +02:00
|
|
|
|
|
2024-04-18 01:44:37 +02:00
|
|
|
|
services.AddTransient<IWinoRequestDelegator, WinoRequestDelegator>();
|
2024-07-21 05:45:02 +02:00
|
|
|
|
services.AddTransient<IWinoRequestProcessor, WinoRequestProcessor>();
|
|
|
|
|
|
|
2024-04-18 01:44:37 +02:00
|
|
|
|
services.AddTransient<IAutoDiscoveryService, AutoDiscoveryService>();
|
|
|
|
|
|
services.AddTransient<IContextMenuItemService, ContextMenuItemService>();
|
|
|
|
|
|
services.AddTransient<IFontService, FontService>();
|
2024-05-02 00:21:29 +02:00
|
|
|
|
services.AddTransient<IUnsubscriptionService, UnsubscriptionService>();
|
2024-07-21 05:45:02 +02:00
|
|
|
|
services.AddTransient<IHtmlPreviewer, HtmlPreviewer>();
|
|
|
|
|
|
|
|
|
|
|
|
services.AddTransient<IOutlookAuthenticator, OutlookAuthenticator>();
|
|
|
|
|
|
services.AddTransient<IGmailAuthenticator, GmailAuthenticator>();
|
|
|
|
|
|
services.AddTransient<IAuthenticationProvider, AuthenticationProvider>();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2024-07-21 05:45:02 +02:00
|
|
|
|
services.AddTransient<IGmailChangeProcessor, GmailChangeProcessor>();
|
|
|
|
|
|
services.AddTransient<IImapChangeProcessor, ImapChangeProcessor>();
|
|
|
|
|
|
services.AddTransient<IOutlookChangeProcessor, OutlookChangeProcessor>();
|
2024-07-18 20:03:58 +02:00
|
|
|
|
|
2024-07-21 05:45:02 +02:00
|
|
|
|
services.AddTransient<IOutlookThreadingStrategy, OutlookThreadingStrategy>();
|
|
|
|
|
|
services.AddTransient<IGmailThreadingStrategy, GmailThreadingStrategy>();
|
|
|
|
|
|
services.AddTransient<IImapThreadStrategy, ImapThreadStrategy>();
|
2024-04-18 01:44:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|