Files
Wino-Mail/Wino.Core.Domain/Models/Folders/AccountFolderTree.cs

34 lines
900 B
C#
Raw Normal View History

2024-04-18 01:44:37 +02:00
using System.Collections.Generic;
using Wino.Core.Domain.Entities.Shared;
2024-04-18 01:44:37 +02:00
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Models.Folders
2024-04-18 01:44:37 +02:00
{
/// <summary>
/// Grouped folder information for the menu for given account.
/// </summary>
public class AccountFolderTree
2025-02-16 11:35:43 +01:00
{
public MailAccount Account { get; }
public List<IMailItemFolder> Folders { get; set; } = new List<IMailItemFolder>();
2024-04-18 01:44:37 +02:00
public AccountFolderTree(MailAccount account)
2024-04-18 01:44:37 +02:00
{
Account = account;
2024-04-18 01:44:37 +02:00
}
2025-02-16 11:35:43 +01:00
public bool HasSpecialTypeFolder(SpecialFolderType type)
{
foreach (var folderStructure in Folders)
{
bool hasSpecialFolder = folderStructure.ContainsSpecialFolderType(type);
if (hasSpecialFolder)
return true;
}
return false;
}
2024-04-18 01:44:37 +02:00
}
}