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

36 lines
878 B
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;
2025-05-18 14:06:25 +02:00
namespace Wino.Calendar.Services;
public class ProviderService : IProviderService
2024-04-18 01:44:37 +02:00
{
2025-05-18 14:06:25 +02:00
public IProviderDetail GetProviderDetail(MailProviderType type)
2024-04-18 01:44:37 +02:00
{
2025-05-18 14:06:25 +02:00
var details = GetAvailableProviders();
2024-04-18 01:44:37 +02:00
2025-05-18 14:06:25 +02:00
return details.FirstOrDefault(a => a.Type == type);
}
2024-04-18 01:44:37 +02:00
2025-05-18 14:06:25 +02:00
public List<IProviderDetail> GetAvailableProviders()
{
var providerList = new List<IProviderDetail>();
2024-04-18 01:44:37 +02:00
2025-05-18 14:06:25 +02:00
var providers = new MailProviderType[]
{
MailProviderType.Outlook,
MailProviderType.Gmail
};
2024-04-18 01:44:37 +02:00
2025-05-18 14:06:25 +02:00
foreach (var type in providers)
{
providerList.Add(new ProviderDetail(type, SpecialImapProvider.None));
2024-04-18 01:44:37 +02:00
}
2025-05-18 14:06:25 +02:00
return providerList;
2024-04-18 01:44:37 +02:00
}
}