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

36 lines
1.2 KiB
C#
Raw Normal View History

2025-11-15 14:52:01 +01:00
using System;
2025-11-14 18:51:48 +01:00
using System.Collections.Generic;
2025-09-29 11:16:14 +02:00
using System.Linq;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Accounts;
namespace Wino.Mail.Services;
/// <summary>
/// Service that is returning available provider details.
/// </summary>
public class ProviderService : IProviderService
{
public IProviderDetail GetProviderDetail(MailProviderType type)
{
var details = GetAvailableProviders();
2025-11-14 18:51:48 +01:00
return details.FirstOrDefault(a => a.Type == type) ?? throw new InvalidOperationException($"Provider detail not found for type: {type}");
2025-09-29 11:16:14 +02:00
}
public List<IProviderDetail> GetAvailableProviders()
{
var providerList = new List<IProviderDetail>
{
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)
};
return providerList;
}
}