Calendar account management page basics.

This commit is contained in:
Burak Kaan Köse
2024-11-11 01:09:05 +01:00
parent 5b0fcd77e5
commit 418eeb7317
34 changed files with 515 additions and 184 deletions

View File

@@ -29,7 +29,6 @@ namespace Wino.Core
services.AddTransient<IOutlookChangeProcessor, OutlookChangeProcessor>();
services.AddTransient<ITokenService, TokenService>();
services.AddTransient<IProviderService, ProviderService>();
services.AddTransient<IFolderService, FolderService>();
services.AddTransient<IMailService, MailService>();
services.AddTransient<IAccountService, AccountService>();

View File

@@ -550,7 +550,7 @@ namespace Wino.Core.Services
{
var folders = new List<MailItemFolder>();
if (options.Type == SynchronizationType.Full)
if (options.Type == SynchronizationType.FullFolders)
{
// Only get sync enabled folders.
@@ -568,11 +568,11 @@ namespace Wino.Core.Services
var mustHaveFolders = await GetInboxSynchronizationFoldersAsync(options.AccountId);
if (options.Type == SynchronizationType.Inbox)
if (options.Type == SynchronizationType.InboxOnly)
{
return mustHaveFolders;
}
else if (options.Type == SynchronizationType.Custom)
else if (options.Type == SynchronizationType.CustomFolders)
{
// Only get the specified and enabled folders.

View File

@@ -1,40 +0,0 @@
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.Core.Services
{
/// <summary>
/// Service that is returning available provider details.
/// </summary>
public class ProviderService : IProviderService
{
public IProviderDetail GetProviderDetail(MailProviderType type)
{
var details = GetProviderDetails();
return details.FirstOrDefault(a => a.Type == type);
}
public List<IProviderDetail> GetProviderDetails()
{
var providerList = new List<IProviderDetail>();
var providers = new MailProviderType[]
{
MailProviderType.Outlook,
MailProviderType.Gmail,
MailProviderType.IMAP4
};
foreach (var type in providers)
{
providerList.Add(new ProviderDetail(type));
}
return providerList;
}
}
}

View File

@@ -397,13 +397,13 @@ namespace Wino.Core.Synchronizers
{
// Gather FolderIds to synchronize.
options.Type = SynchronizationType.Custom;
options.Type = SynchronizationType.CustomFolders;
options.SynchronizationFolderIds = synchronizationFolderIds;
}
else
{
// At this point it's a mix of everything. Do full sync.
options.Type = SynchronizationType.Full;
options.Type = SynchronizationType.FullFolders;
}
return options;

View File

@@ -956,7 +956,7 @@ namespace Wino.Core.Synchronizers.Mail
var options = new SynchronizationOptions()
{
AccountId = Account.Id,
Type = SynchronizationType.Full
Type = SynchronizationType.FullFolders
};
await SynchronizeInternalAsync(options, cancellationToken);

View File

@@ -437,7 +437,7 @@ namespace Wino.Core.Synchronizers.Mail
PublishSynchronizationProgress(1);
bool shouldDoFolderSync = options.Type == SynchronizationType.Full || options.Type == SynchronizationType.FoldersOnly;
bool shouldDoFolderSync = options.Type == SynchronizationType.FullFolders || options.Type == SynchronizationType.FoldersOnly;
if (shouldDoFolderSync)
{