Files
Wino-Mail/Wino.Mail/Services/ProviderService.cs

36 lines
1.2 KiB
C#
Raw Normal View History

2024-04-18 01:44:37 +02:00
using System.Collections.Generic;
using System.Linq;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Accounts;
namespace Wino.Mail.Services
2024-04-18 01:44:37 +02:00
{
/// <summary>
/// Service that is returning available provider details.
/// </summary>
public class ProviderService : IProviderService
{
public IProviderDetail GetProviderDetail(MailProviderType type)
{
var details = GetAvailableProviders();
2024-04-18 01:44:37 +02:00
return details.FirstOrDefault(a => a.Type == type);
}
public List<IProviderDetail> GetAvailableProviders()
2024-04-18 01:44:37 +02:00
{
2025-02-15 12:53:32 +01:00
var providerList = new List<IProviderDetail>
2024-04-18 01:44:37 +02:00
{
2025-02-15 12:53:32 +01:00
new ProviderDetail(MailProviderType.Outlook, SpecialImapProvider.None),
new ProviderDetail(MailProviderType.Gmail, SpecialImapProvider.None),
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.iCloud),
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.Yahoo),
new ProviderDetail(MailProviderType.IMAP4, SpecialImapProvider.None)
2024-04-18 01:44:37 +02:00
};
return providerList;
}
}
}