diff --git a/.editorconfig b/.editorconfig
index c686ec1f..b06e6570 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -149,7 +149,7 @@ csharp_preferred_modifier_order = public,private,protected,internal,static,exter
# Code-block preferences
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
-csharp_style_namespace_declarations = block_scoped:silent
+csharp_style_namespace_declarations = file_scoped:error
# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
@@ -287,4 +287,6 @@ csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
-csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
\ No newline at end of file
+csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent
+csharp_style_prefer_primary_constructors = true:silent
+csharp_prefer_system_threading_lock = true:suggestion
\ No newline at end of file
diff --git a/Wino.Authentication/BaseAuthenticator.cs b/Wino.Authentication/BaseAuthenticator.cs
index 4e3664df..29fbb757 100644
--- a/Wino.Authentication/BaseAuthenticator.cs
+++ b/Wino.Authentication/BaseAuthenticator.cs
@@ -1,17 +1,16 @@
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
-namespace Wino.Authentication
+namespace Wino.Authentication;
+
+public abstract class BaseAuthenticator
{
- public abstract class BaseAuthenticator
+ public abstract MailProviderType ProviderType { get; }
+ protected IAuthenticatorConfig AuthenticatorConfig { get; }
+
+ protected BaseAuthenticator(IAuthenticatorConfig authenticatorConfig)
{
- public abstract MailProviderType ProviderType { get; }
- protected IAuthenticatorConfig AuthenticatorConfig { get; }
- protected BaseAuthenticator(IAuthenticatorConfig authenticatorConfig)
- {
-
- AuthenticatorConfig = authenticatorConfig;
- }
+ AuthenticatorConfig = authenticatorConfig;
}
}
diff --git a/Wino.Authentication/GmailAuthenticator.cs b/Wino.Authentication/GmailAuthenticator.cs
index 901df797..506d0448 100644
--- a/Wino.Authentication/GmailAuthenticator.cs
+++ b/Wino.Authentication/GmailAuthenticator.cs
@@ -7,45 +7,44 @@ using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Authentication;
-namespace Wino.Authentication
+namespace Wino.Authentication;
+
+public class GmailAuthenticator : BaseAuthenticator, IGmailAuthenticator
{
- public class GmailAuthenticator : BaseAuthenticator, IGmailAuthenticator
+ public GmailAuthenticator(IAuthenticatorConfig authConfig) : base(authConfig)
{
- public GmailAuthenticator(IAuthenticatorConfig authConfig) : base(authConfig)
+ }
+
+ public string ClientId => AuthenticatorConfig.GmailAuthenticatorClientId;
+ public bool ProposeCopyAuthURL { get; set; }
+
+ public override MailProviderType ProviderType => MailProviderType.Gmail;
+
+ ///
+ /// Generates the token information for the given account.
+ /// For gmail, interactivity is automatically handled when you get the token.
+ ///
+ /// Account to get token for.
+ public Task GenerateTokenInformationAsync(MailAccount account)
+ => GetTokenInformationAsync(account);
+
+ public async Task GetTokenInformationAsync(MailAccount account)
+ {
+ var userCredential = await GetGoogleUserCredentialAsync(account);
+
+ if (userCredential.Token.IsStale)
{
+ await userCredential.RefreshTokenAsync(CancellationToken.None);
}
- public string ClientId => AuthenticatorConfig.GmailAuthenticatorClientId;
- public bool ProposeCopyAuthURL { get; set; }
+ return new TokenInformationEx(userCredential.Token.AccessToken, account.Address);
+ }
- public override MailProviderType ProviderType => MailProviderType.Gmail;
-
- ///
- /// Generates the token information for the given account.
- /// For gmail, interactivity is automatically handled when you get the token.
- ///
- /// Account to get token for.
- public Task GenerateTokenInformationAsync(MailAccount account)
- => GetTokenInformationAsync(account);
-
- public async Task GetTokenInformationAsync(MailAccount account)
+ private Task GetGoogleUserCredentialAsync(MailAccount account)
+ {
+ return GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets()
{
- var userCredential = await GetGoogleUserCredentialAsync(account);
-
- if (userCredential.Token.IsStale)
- {
- await userCredential.RefreshTokenAsync(CancellationToken.None);
- }
-
- return new TokenInformationEx(userCredential.Token.AccessToken, account.Address);
- }
-
- private Task GetGoogleUserCredentialAsync(MailAccount account)
- {
- return GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets()
- {
- ClientId = ClientId
- }, AuthenticatorConfig.GmailScope, account.Id.ToString(), CancellationToken.None, new FileDataStore(AuthenticatorConfig.GmailTokenStoreIdentifier));
- }
+ ClientId = ClientId
+ }, AuthenticatorConfig.GmailScope, account.Id.ToString(), CancellationToken.None, new FileDataStore(AuthenticatorConfig.GmailTokenStoreIdentifier));
}
}
diff --git a/Wino.Authentication/OutlookAuthenticator.cs b/Wino.Authentication/OutlookAuthenticator.cs
index 8bdcfb27..106f9717 100644
--- a/Wino.Authentication/OutlookAuthenticator.cs
+++ b/Wino.Authentication/OutlookAuthenticator.cs
@@ -11,116 +11,115 @@ using Wino.Core.Domain.Exceptions;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Authentication;
-namespace Wino.Authentication
+namespace Wino.Authentication;
+
+public class OutlookAuthenticator : BaseAuthenticator, IOutlookAuthenticator
{
- public class OutlookAuthenticator : BaseAuthenticator, IOutlookAuthenticator
+ private const string TokenCacheFileName = "OutlookCache.bin";
+ private bool isTokenCacheAttached = false;
+
+ // Outlook
+ private const string Authority = "https://login.microsoftonline.com/common";
+
+ public override MailProviderType ProviderType => MailProviderType.Outlook;
+
+ private readonly IPublicClientApplication _publicClientApplication;
+ private readonly IApplicationConfiguration _applicationConfiguration;
+
+ public OutlookAuthenticator(INativeAppService nativeAppService,
+ IApplicationConfiguration applicationConfiguration,
+ IAuthenticatorConfig authenticatorConfig) : base(authenticatorConfig)
{
- private const string TokenCacheFileName = "OutlookCache.bin";
- private bool isTokenCacheAttached = false;
+ _applicationConfiguration = applicationConfiguration;
- // Outlook
- private const string Authority = "https://login.microsoftonline.com/common";
+ var authenticationRedirectUri = nativeAppService.GetWebAuthenticationBrokerUri();
- public override MailProviderType ProviderType => MailProviderType.Outlook;
-
- private readonly IPublicClientApplication _publicClientApplication;
- private readonly IApplicationConfiguration _applicationConfiguration;
-
- public OutlookAuthenticator(INativeAppService nativeAppService,
- IApplicationConfiguration applicationConfiguration,
- IAuthenticatorConfig authenticatorConfig) : base(authenticatorConfig)
+ var options = new BrokerOptions(BrokerOptions.OperatingSystems.Windows)
{
- _applicationConfiguration = applicationConfiguration;
+ Title = "Wino Mail",
+ ListOperatingSystemAccounts = true,
+ };
- var authenticationRedirectUri = nativeAppService.GetWebAuthenticationBrokerUri();
+ var outlookAppBuilder = PublicClientApplicationBuilder.Create(AuthenticatorConfig.OutlookAuthenticatorClientId)
+ .WithParentActivityOrWindow(nativeAppService.GetCoreWindowHwnd)
+ .WithBroker(options)
+ .WithDefaultRedirectUri()
+ .WithAuthority(Authority);
- var options = new BrokerOptions(BrokerOptions.OperatingSystems.Windows)
- {
- Title = "Wino Mail",
- ListOperatingSystemAccounts = true,
- };
+ _publicClientApplication = outlookAppBuilder.Build();
+ }
- var outlookAppBuilder = PublicClientApplicationBuilder.Create(AuthenticatorConfig.OutlookAuthenticatorClientId)
- .WithParentActivityOrWindow(nativeAppService.GetCoreWindowHwnd)
- .WithBroker(options)
- .WithDefaultRedirectUri()
- .WithAuthority(Authority);
+ public string[] Scope => AuthenticatorConfig.OutlookScope;
- _publicClientApplication = outlookAppBuilder.Build();
- }
-
- public string[] Scope => AuthenticatorConfig.OutlookScope;
-
- private async Task EnsureTokenCacheAttachedAsync()
+ private async Task EnsureTokenCacheAttachedAsync()
+ {
+ if (!isTokenCacheAttached)
{
- if (!isTokenCacheAttached)
- {
- var storageProperties = new StorageCreationPropertiesBuilder(TokenCacheFileName, _applicationConfiguration.PublisherSharedFolderPath).Build();
- var msalcachehelper = await MsalCacheHelper.CreateAsync(storageProperties);
- msalcachehelper.RegisterCache(_publicClientApplication.UserTokenCache);
+ var storageProperties = new StorageCreationPropertiesBuilder(TokenCacheFileName, _applicationConfiguration.PublisherSharedFolderPath).Build();
+ var msalcachehelper = await MsalCacheHelper.CreateAsync(storageProperties);
+ msalcachehelper.RegisterCache(_publicClientApplication.UserTokenCache);
- isTokenCacheAttached = true;
- }
+ isTokenCacheAttached = true;
}
+ }
- public async Task GetTokenInformationAsync(MailAccount account)
+ public async Task GetTokenInformationAsync(MailAccount account)
+ {
+ await EnsureTokenCacheAttachedAsync();
+
+ var storedAccount = (await _publicClientApplication.GetAccountsAsync()).FirstOrDefault(a => a.Username == account.Address);
+
+ if (storedAccount == null)
+ return await GenerateTokenInformationAsync(account);
+
+ try
+ {
+ var authResult = await _publicClientApplication.AcquireTokenSilent(Scope, storedAccount).ExecuteAsync();
+
+ return new TokenInformationEx(authResult.AccessToken, authResult.Account.Username);
+ }
+ catch (MsalUiRequiredException)
+ {
+ // Somehow MSAL is not able to refresh the token silently.
+ // Force interactive login.
+
+ return await GenerateTokenInformationAsync(account);
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ public async Task GenerateTokenInformationAsync(MailAccount account)
+ {
+ try
{
await EnsureTokenCacheAttachedAsync();
- var storedAccount = (await _publicClientApplication.GetAccountsAsync()).FirstOrDefault(a => a.Username == account.Address);
+ var authResult = await _publicClientApplication
+ .AcquireTokenInteractive(Scope)
+ .ExecuteAsync();
- if (storedAccount == null)
- return await GenerateTokenInformationAsync(account);
+ // If the account is null, it means it's the initial creation of it.
+ // If not, make sure the authenticated user address matches the username.
+ // When people refresh their token, accounts must match.
- try
+ if (account?.Address != null && !account.Address.Equals(authResult.Account.Username, StringComparison.OrdinalIgnoreCase))
{
- var authResult = await _publicClientApplication.AcquireTokenSilent(Scope, storedAccount).ExecuteAsync();
+ throw new AuthenticationException("Authenticated address does not match with your account address.");
+ }
- return new TokenInformationEx(authResult.AccessToken, authResult.Account.Username);
- }
- catch (MsalUiRequiredException)
- {
- // Somehow MSAL is not able to refresh the token silently.
- // Force interactive login.
-
- return await GenerateTokenInformationAsync(account);
- }
- catch (Exception)
- {
- throw;
- }
+ return new TokenInformationEx(authResult.AccessToken, authResult.Account.Username);
}
-
- public async Task GenerateTokenInformationAsync(MailAccount account)
+ catch (MsalClientException msalClientException)
{
- try
- {
- await EnsureTokenCacheAttachedAsync();
+ if (msalClientException.ErrorCode == "authentication_canceled" || msalClientException.ErrorCode == "access_denied")
+ throw new AccountSetupCanceledException();
- var authResult = await _publicClientApplication
- .AcquireTokenInteractive(Scope)
- .ExecuteAsync();
-
- // If the account is null, it means it's the initial creation of it.
- // If not, make sure the authenticated user address matches the username.
- // When people refresh their token, accounts must match.
-
- if (account?.Address != null && !account.Address.Equals(authResult.Account.Username, StringComparison.OrdinalIgnoreCase))
- {
- throw new AuthenticationException("Authenticated address does not match with your account address.");
- }
-
- return new TokenInformationEx(authResult.AccessToken, authResult.Account.Username);
- }
- catch (MsalClientException msalClientException)
- {
- if (msalClientException.ErrorCode == "authentication_canceled" || msalClientException.ErrorCode == "access_denied")
- throw new AccountSetupCanceledException();
-
- throw;
- }
-
- throw new AuthenticationException(Translator.Exception_UnknowErrorDuringAuthentication, new Exception(Translator.Exception_TokenGenerationFailed));
+ throw;
}
+
+ throw new AuthenticationException(Translator.Exception_UnknowErrorDuringAuthentication, new Exception(Translator.Exception_TokenGenerationFailed));
}
}
diff --git a/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs b/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs
index f139ff59..391ff7f2 100644
--- a/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs
+++ b/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs
@@ -1,33 +1,32 @@
using Wino.Core.Domain.Interfaces;
-namespace Wino.Calendar.Services
+namespace Wino.Calendar.Services;
+
+public class CalendarAuthenticatorConfig : IAuthenticatorConfig
{
- public class CalendarAuthenticatorConfig : IAuthenticatorConfig
+ public string OutlookAuthenticatorClientId => "b19c2035-d740-49ff-b297-de6ec561b208";
+
+ public string[] OutlookScope => new string[]
{
- public string OutlookAuthenticatorClientId => "b19c2035-d740-49ff-b297-de6ec561b208";
+ "Calendars.Read",
+ "Calendars.Read.Shared",
+ "offline_access",
+ "Calendars.ReadBasic",
+ "Calendars.ReadWrite",
+ "Calendars.ReadWrite.Shared",
+ "User.Read"
+ };
- public string[] OutlookScope => new string[]
- {
- "Calendars.Read",
- "Calendars.Read.Shared",
- "offline_access",
- "Calendars.ReadBasic",
- "Calendars.ReadWrite",
- "Calendars.ReadWrite.Shared",
- "User.Read"
- };
+ public string GmailAuthenticatorClientId => "973025879644-s7b4ur9p3rlgop6a22u7iuptdc0brnrn.apps.googleusercontent.com";
- public string GmailAuthenticatorClientId => "973025879644-s7b4ur9p3rlgop6a22u7iuptdc0brnrn.apps.googleusercontent.com";
+ public string[] GmailScope => new string[]
+ {
+ "https://www.googleapis.com/auth/calendar",
+ "https://www.googleapis.com/auth/calendar.events",
+ "https://www.googleapis.com/auth/calendar.settings.readonly",
+ "https://www.googleapis.com/auth/userinfo.profile",
+ "https://www.googleapis.com/auth/userinfo.email"
+ };
- public string[] GmailScope => new string[]
- {
- "https://www.googleapis.com/auth/calendar",
- "https://www.googleapis.com/auth/calendar.events",
- "https://www.googleapis.com/auth/calendar.settings.readonly",
- "https://www.googleapis.com/auth/userinfo.profile",
- "https://www.googleapis.com/auth/userinfo.email"
- };
-
- public string GmailTokenStoreIdentifier => "WinoCalendarGmailTokenStore";
- }
+ public string GmailTokenStoreIdentifier => "WinoCalendarGmailTokenStore";
}
diff --git a/Wino.Core.Domain/Collections/CalendarEventCollection.cs b/Wino.Core.Domain/Collections/CalendarEventCollection.cs
index f6eb6c68..94a1eef6 100644
--- a/Wino.Core.Domain/Collections/CalendarEventCollection.cs
+++ b/Wino.Core.Domain/Collections/CalendarEventCollection.cs
@@ -7,150 +7,149 @@ using Wino.Core.Domain.Entities.Calendar;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Calendar;
-namespace Wino.Core.Domain.Collections
+namespace Wino.Core.Domain.Collections;
+
+public class CalendarEventCollection
{
- public class CalendarEventCollection
+ public event EventHandler CalendarItemAdded;
+ public event EventHandler CalendarItemRemoved;
+
+ public event EventHandler CalendarItemsCleared;
+
+ private ObservableRangeCollection _internalRegularEvents = [];
+ private ObservableRangeCollection _internalAllDayEvents = [];
+
+ public ReadOnlyObservableCollection RegularEvents { get; }
+ public ReadOnlyObservableCollection AllDayEvents { get; } // TODO: Rename this to include multi-day events.
+ public ITimePeriod Period { get; }
+ public CalendarSettings Settings { get; }
+
+ private readonly List _allItems = new List();
+
+ public CalendarEventCollection(ITimePeriod period, CalendarSettings settings)
{
- public event EventHandler CalendarItemAdded;
- public event EventHandler CalendarItemRemoved;
+ Period = period;
+ Settings = settings;
- public event EventHandler CalendarItemsCleared;
+ RegularEvents = new ReadOnlyObservableCollection(_internalRegularEvents);
+ AllDayEvents = new ReadOnlyObservableCollection(_internalAllDayEvents);
+ }
- private ObservableRangeCollection _internalRegularEvents = [];
- private ObservableRangeCollection _internalAllDayEvents = [];
+ public bool HasCalendarEvent(AccountCalendar accountCalendar)
+ => _allItems.Any(x => x.AssignedCalendar.Id == accountCalendar.Id);
- public ReadOnlyObservableCollection RegularEvents { get; }
- public ReadOnlyObservableCollection AllDayEvents { get; } // TODO: Rename this to include multi-day events.
- public ITimePeriod Period { get; }
- public CalendarSettings Settings { get; }
+ public ICalendarItem GetCalendarItem(Guid calendarItemId)
+ {
+ return _allItems.FirstOrDefault(x => x.Id == calendarItemId);
+ }
- private readonly List _allItems = new List();
-
- public CalendarEventCollection(ITimePeriod period, CalendarSettings settings)
+ public void ClearSelectionStates()
+ {
+ foreach (var item in _allItems)
{
- Period = period;
- Settings = settings;
-
- RegularEvents = new ReadOnlyObservableCollection(_internalRegularEvents);
- AllDayEvents = new ReadOnlyObservableCollection(_internalAllDayEvents);
- }
-
- public bool HasCalendarEvent(AccountCalendar accountCalendar)
- => _allItems.Any(x => x.AssignedCalendar.Id == accountCalendar.Id);
-
- public ICalendarItem GetCalendarItem(Guid calendarItemId)
- {
- return _allItems.FirstOrDefault(x => x.Id == calendarItemId);
- }
-
- public void ClearSelectionStates()
- {
- foreach (var item in _allItems)
+ if (item is ICalendarItemViewModel calendarItemViewModel)
{
- if (item is ICalendarItemViewModel calendarItemViewModel)
- {
- calendarItemViewModel.IsSelected = false;
- }
+ calendarItemViewModel.IsSelected = false;
}
}
-
- public void FilterByCalendars(IEnumerable visibleCalendarIds)
- {
- foreach (var item in _allItems)
- {
- var collections = GetProperCollectionsForCalendarItem(item);
-
- foreach (var collection in collections)
- {
- if (!visibleCalendarIds.Contains(item.AssignedCalendar.Id) && collection.Contains(item))
- {
- RemoveCalendarItemInternal(collection, item, false);
- }
- else if (visibleCalendarIds.Contains(item.AssignedCalendar.Id) && !collection.Contains(item))
- {
- AddCalendarItemInternal(collection, item, false);
- }
- }
- }
- }
-
- private IEnumerable> GetProperCollectionsForCalendarItem(ICalendarItem calendarItem)
- {
- // All-day events go to all days.
- // Multi-day events go to both.
- // Anything else goes to regular.
-
- if (calendarItem.IsAllDayEvent)
- {
- return [_internalAllDayEvents];
- }
- else if (calendarItem.IsMultiDayEvent)
- {
- return [_internalRegularEvents, _internalAllDayEvents];
- }
- else
- {
- return [_internalRegularEvents];
- }
- }
-
- public void AddCalendarItem(ICalendarItem calendarItem)
- {
- var collections = GetProperCollectionsForCalendarItem(calendarItem);
-
- foreach (var collection in collections)
- {
- AddCalendarItemInternal(collection, calendarItem);
- }
- }
-
- public void RemoveCalendarItem(ICalendarItem calendarItem)
- {
- var collections = GetProperCollectionsForCalendarItem(calendarItem);
-
- foreach (var collection in collections)
- {
- RemoveCalendarItemInternal(collection, calendarItem);
- }
- }
-
- private void AddCalendarItemInternal(ObservableRangeCollection collection, ICalendarItem calendarItem, bool create = true)
- {
- if (calendarItem is not ICalendarItemViewModel)
- throw new ArgumentException("CalendarItem must be of type ICalendarItemViewModel", nameof(calendarItem));
-
- collection.Add(calendarItem);
-
- if (create)
- {
- _allItems.Add(calendarItem);
- }
-
- CalendarItemAdded?.Invoke(this, calendarItem);
- }
-
- private void RemoveCalendarItemInternal(ObservableRangeCollection collection, ICalendarItem calendarItem, bool destroy = true)
- {
- if (calendarItem is not ICalendarItemViewModel)
- throw new ArgumentException("CalendarItem must be of type ICalendarItemViewModel", nameof(calendarItem));
-
- collection.Remove(calendarItem);
-
- if (destroy)
- {
- _allItems.Remove(calendarItem);
- }
-
- CalendarItemRemoved?.Invoke(this, calendarItem);
- }
-
- public void Clear()
- {
- _internalAllDayEvents.Clear();
- _internalRegularEvents.Clear();
- _allItems.Clear();
-
- CalendarItemsCleared?.Invoke(this, EventArgs.Empty);
- }
+ }
+
+ public void FilterByCalendars(IEnumerable visibleCalendarIds)
+ {
+ foreach (var item in _allItems)
+ {
+ var collections = GetProperCollectionsForCalendarItem(item);
+
+ foreach (var collection in collections)
+ {
+ if (!visibleCalendarIds.Contains(item.AssignedCalendar.Id) && collection.Contains(item))
+ {
+ RemoveCalendarItemInternal(collection, item, false);
+ }
+ else if (visibleCalendarIds.Contains(item.AssignedCalendar.Id) && !collection.Contains(item))
+ {
+ AddCalendarItemInternal(collection, item, false);
+ }
+ }
+ }
+ }
+
+ private IEnumerable> GetProperCollectionsForCalendarItem(ICalendarItem calendarItem)
+ {
+ // All-day events go to all days.
+ // Multi-day events go to both.
+ // Anything else goes to regular.
+
+ if (calendarItem.IsAllDayEvent)
+ {
+ return [_internalAllDayEvents];
+ }
+ else if (calendarItem.IsMultiDayEvent)
+ {
+ return [_internalRegularEvents, _internalAllDayEvents];
+ }
+ else
+ {
+ return [_internalRegularEvents];
+ }
+ }
+
+ public void AddCalendarItem(ICalendarItem calendarItem)
+ {
+ var collections = GetProperCollectionsForCalendarItem(calendarItem);
+
+ foreach (var collection in collections)
+ {
+ AddCalendarItemInternal(collection, calendarItem);
+ }
+ }
+
+ public void RemoveCalendarItem(ICalendarItem calendarItem)
+ {
+ var collections = GetProperCollectionsForCalendarItem(calendarItem);
+
+ foreach (var collection in collections)
+ {
+ RemoveCalendarItemInternal(collection, calendarItem);
+ }
+ }
+
+ private void AddCalendarItemInternal(ObservableRangeCollection collection, ICalendarItem calendarItem, bool create = true)
+ {
+ if (calendarItem is not ICalendarItemViewModel)
+ throw new ArgumentException("CalendarItem must be of type ICalendarItemViewModel", nameof(calendarItem));
+
+ collection.Add(calendarItem);
+
+ if (create)
+ {
+ _allItems.Add(calendarItem);
+ }
+
+ CalendarItemAdded?.Invoke(this, calendarItem);
+ }
+
+ private void RemoveCalendarItemInternal(ObservableRangeCollection collection, ICalendarItem calendarItem, bool destroy = true)
+ {
+ if (calendarItem is not ICalendarItemViewModel)
+ throw new ArgumentException("CalendarItem must be of type ICalendarItemViewModel", nameof(calendarItem));
+
+ collection.Remove(calendarItem);
+
+ if (destroy)
+ {
+ _allItems.Remove(calendarItem);
+ }
+
+ CalendarItemRemoved?.Invoke(this, calendarItem);
+ }
+
+ public void Clear()
+ {
+ _internalAllDayEvents.Clear();
+ _internalRegularEvents.Clear();
+ _allItems.Clear();
+
+ CalendarItemsCleared?.Invoke(this, EventArgs.Empty);
}
}
diff --git a/Wino.Core.Domain/Collections/DayRangeCollection.cs b/Wino.Core.Domain/Collections/DayRangeCollection.cs
index ec8dd5db..89afeb68 100644
--- a/Wino.Core.Domain/Collections/DayRangeCollection.cs
+++ b/Wino.Core.Domain/Collections/DayRangeCollection.cs
@@ -2,41 +2,40 @@
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Calendar;
-namespace Wino.Core.Domain.Collections
+namespace Wino.Core.Domain.Collections;
+
+public class DayRangeCollection : ObservableRangeCollection
{
- public class DayRangeCollection : ObservableRangeCollection
+ ///
+ /// Gets the range of dates that are currently displayed in the collection.
+ ///
+ public DateRange DisplayRange
{
- ///
- /// Gets the range of dates that are currently displayed in the collection.
- ///
- public DateRange DisplayRange
+ get
{
- get
- {
- if (Count == 0) return null;
+ if (Count == 0) return null;
- var minimumLoadedDate = this[0].CalendarRenderOptions.DateRange.StartDate;
- var maximumLoadedDate = this[Count - 1].CalendarRenderOptions.DateRange.EndDate;
+ var minimumLoadedDate = this[0].CalendarRenderOptions.DateRange.StartDate;
+ var maximumLoadedDate = this[Count - 1].CalendarRenderOptions.DateRange.EndDate;
- return new DateRange(minimumLoadedDate, maximumLoadedDate);
- }
+ return new DateRange(minimumLoadedDate, maximumLoadedDate);
}
+ }
- public void RemoveCalendarItem(ICalendarItem calendarItem)
+ public void RemoveCalendarItem(ICalendarItem calendarItem)
+ {
+ foreach (var dayRange in this)
{
- foreach (var dayRange in this)
- {
- }
}
+ }
- public void AddCalendarItem(ICalendarItem calendarItem)
+ public void AddCalendarItem(ICalendarItem calendarItem)
+ {
+ foreach (var dayRange in this)
{
- foreach (var dayRange in this)
- {
- var calendarDayModel = dayRange.CalendarDays.FirstOrDefault(x => x.Period.HasInside(calendarItem.Period.Start));
- calendarDayModel?.EventsCollection.AddCalendarItem(calendarItem);
- }
+ var calendarDayModel = dayRange.CalendarDays.FirstOrDefault(x => x.Period.HasInside(calendarItem.Period.Start));
+ calendarDayModel?.EventsCollection.AddCalendarItem(calendarItem);
}
}
}
diff --git a/Wino.Core.Domain/Collections/ObservableRangeCollection.cs b/Wino.Core.Domain/Collections/ObservableRangeCollection.cs
index b3531c95..e1869554 100644
--- a/Wino.Core.Domain/Collections/ObservableRangeCollection.cs
+++ b/Wino.Core.Domain/Collections/ObservableRangeCollection.cs
@@ -4,171 +4,170 @@ using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
-namespace Wino.Core.Domain.Collections
+namespace Wino.Core.Domain.Collections;
+
+///
+/// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
+///
+///
+public class ObservableRangeCollection : ObservableCollection
{
+
///
- /// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
+ /// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class.
///
- ///
- public class ObservableRangeCollection : ObservableCollection
+ public ObservableRangeCollection()
+ : base()
{
+ }
- ///
- /// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class.
- ///
- public ObservableRangeCollection()
- : base()
+ ///
+ /// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class that contains elements copied from the specified collection.
+ ///
+ /// collection: The collection from which the elements are copied.
+ /// The collection parameter cannot be null.
+ public ObservableRangeCollection(IEnumerable collection)
+ : base(collection)
+ {
+ }
+
+ ///
+ /// Adds the elements of the specified collection to the end of the ObservableCollection(Of T).
+ ///
+ public void AddRange(IEnumerable collection, NotifyCollectionChangedAction notificationMode = NotifyCollectionChangedAction.Add)
+ {
+ if (notificationMode != NotifyCollectionChangedAction.Add && notificationMode != NotifyCollectionChangedAction.Reset)
+ throw new ArgumentException("Mode must be either Add or Reset for AddRange.", nameof(notificationMode));
+ if (collection == null)
+ throw new ArgumentNullException(nameof(collection));
+
+ CheckReentrancy();
+
+ var startIndex = Count;
+
+ var itemsAdded = AddArrangeCore(collection);
+
+ if (!itemsAdded)
+ return;
+
+ if (notificationMode == NotifyCollectionChangedAction.Reset)
{
- }
-
- ///
- /// Initializes a new instance of the System.Collections.ObjectModel.ObservableCollection(Of T) class that contains elements copied from the specified collection.
- ///
- /// collection: The collection from which the elements are copied.
- /// The collection parameter cannot be null.
- public ObservableRangeCollection(IEnumerable collection)
- : base(collection)
- {
- }
-
- ///
- /// Adds the elements of the specified collection to the end of the ObservableCollection(Of T).
- ///
- public void AddRange(IEnumerable collection, NotifyCollectionChangedAction notificationMode = NotifyCollectionChangedAction.Add)
- {
- if (notificationMode != NotifyCollectionChangedAction.Add && notificationMode != NotifyCollectionChangedAction.Reset)
- throw new ArgumentException("Mode must be either Add or Reset for AddRange.", nameof(notificationMode));
- if (collection == null)
- throw new ArgumentNullException(nameof(collection));
-
- CheckReentrancy();
-
- var startIndex = Count;
-
- var itemsAdded = AddArrangeCore(collection);
-
- if (!itemsAdded)
- return;
-
- if (notificationMode == NotifyCollectionChangedAction.Reset)
- {
- RaiseChangeNotificationEvents(action: NotifyCollectionChangedAction.Reset);
-
- return;
- }
-
- var changedItems = collection is List ? (List)collection : new List(collection);
-
- RaiseChangeNotificationEvents(
- action: NotifyCollectionChangedAction.Add,
- changedItems: changedItems,
- startingIndex: startIndex);
- }
-
- ///
- /// Removes the first occurence of each item in the specified collection from ObservableCollection(Of T). NOTE: with notificationMode = Remove, removed items starting index is not set because items are not guaranteed to be consecutive.
- ///
- public void RemoveRange(IEnumerable collection, NotifyCollectionChangedAction notificationMode = NotifyCollectionChangedAction.Reset)
- {
- if (notificationMode != NotifyCollectionChangedAction.Remove && notificationMode != NotifyCollectionChangedAction.Reset)
- throw new ArgumentException("Mode must be either Remove or Reset for RemoveRange.", nameof(notificationMode));
- if (collection == null)
- throw new ArgumentNullException(nameof(collection));
-
- CheckReentrancy();
-
- if (notificationMode == NotifyCollectionChangedAction.Reset)
- {
- var raiseEvents = false;
- foreach (var item in collection)
- {
- Items.Remove(item);
- raiseEvents = true;
- }
-
- if (raiseEvents)
- RaiseChangeNotificationEvents(action: NotifyCollectionChangedAction.Reset);
-
- return;
- }
-
- var changedItems = new List(collection);
- for (var i = 0; i < changedItems.Count; i++)
- {
- if (!Items.Remove(changedItems[i]))
- {
- changedItems.RemoveAt(i); //Can't use a foreach because changedItems is intended to be (carefully) modified
- i--;
- }
- }
-
- if (changedItems.Count == 0)
- return;
-
- RaiseChangeNotificationEvents(
- action: NotifyCollectionChangedAction.Remove,
- changedItems: changedItems);
- }
-
- ///
- /// Clears the current collection and replaces it with the specified item.
- ///
- public void Replace(T item) => ReplaceRange(new T[] { item });
-
- ///
- /// Clears the current collection and replaces it with the specified collection.
- ///
- public void ReplaceRange(IEnumerable collection)
- {
- if (collection == null)
- throw new ArgumentNullException(nameof(collection));
-
- CheckReentrancy();
-
- var previouslyEmpty = Items.Count == 0;
-
- Items.Clear();
-
- AddArrangeCore(collection);
-
- var currentlyEmpty = Items.Count == 0;
-
- if (previouslyEmpty && currentlyEmpty)
- return;
-
RaiseChangeNotificationEvents(action: NotifyCollectionChangedAction.Reset);
+
+ return;
}
- public void InsertRange(IEnumerable items)
+ var changedItems = collection is List ? (List)collection : new List(collection);
+
+ RaiseChangeNotificationEvents(
+ action: NotifyCollectionChangedAction.Add,
+ changedItems: changedItems,
+ startingIndex: startIndex);
+ }
+
+ ///
+ /// Removes the first occurence of each item in the specified collection from ObservableCollection(Of T). NOTE: with notificationMode = Remove, removed items starting index is not set because items are not guaranteed to be consecutive.
+ ///
+ public void RemoveRange(IEnumerable collection, NotifyCollectionChangedAction notificationMode = NotifyCollectionChangedAction.Reset)
+ {
+ if (notificationMode != NotifyCollectionChangedAction.Remove && notificationMode != NotifyCollectionChangedAction.Reset)
+ throw new ArgumentException("Mode must be either Remove or Reset for RemoveRange.", nameof(notificationMode));
+ if (collection == null)
+ throw new ArgumentNullException(nameof(collection));
+
+ CheckReentrancy();
+
+ if (notificationMode == NotifyCollectionChangedAction.Reset)
{
- CheckReentrancy();
-
- foreach (var item in items)
- Items.Insert(0, item);
-
- OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
- }
-
- private bool AddArrangeCore(IEnumerable collection)
- {
- var itemAdded = false;
+ var raiseEvents = false;
foreach (var item in collection)
{
- Items.Add(item);
- itemAdded = true;
+ Items.Remove(item);
+ raiseEvents = true;
}
- return itemAdded;
+
+ if (raiseEvents)
+ RaiseChangeNotificationEvents(action: NotifyCollectionChangedAction.Reset);
+
+ return;
}
- private void RaiseChangeNotificationEvents(NotifyCollectionChangedAction action, List changedItems = null, int startingIndex = -1)
+ var changedItems = new List(collection);
+ for (var i = 0; i < changedItems.Count; i++)
{
- OnPropertyChanged(new PropertyChangedEventArgs(nameof(Count)));
- OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
-
- if (changedItems is null)
- OnCollectionChanged(new NotifyCollectionChangedEventArgs(action));
- else
- OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, changedItems: changedItems, startingIndex: startingIndex));
+ if (!Items.Remove(changedItems[i]))
+ {
+ changedItems.RemoveAt(i); //Can't use a foreach because changedItems is intended to be (carefully) modified
+ i--;
+ }
}
+
+ if (changedItems.Count == 0)
+ return;
+
+ RaiseChangeNotificationEvents(
+ action: NotifyCollectionChangedAction.Remove,
+ changedItems: changedItems);
+ }
+
+ ///
+ /// Clears the current collection and replaces it with the specified item.
+ ///
+ public void Replace(T item) => ReplaceRange(new T[] { item });
+
+ ///
+ /// Clears the current collection and replaces it with the specified collection.
+ ///
+ public void ReplaceRange(IEnumerable collection)
+ {
+ if (collection == null)
+ throw new ArgumentNullException(nameof(collection));
+
+ CheckReentrancy();
+
+ var previouslyEmpty = Items.Count == 0;
+
+ Items.Clear();
+
+ AddArrangeCore(collection);
+
+ var currentlyEmpty = Items.Count == 0;
+
+ if (previouslyEmpty && currentlyEmpty)
+ return;
+
+ RaiseChangeNotificationEvents(action: NotifyCollectionChangedAction.Reset);
+ }
+
+ public void InsertRange(IEnumerable items)
+ {
+ CheckReentrancy();
+
+ foreach (var item in items)
+ Items.Insert(0, item);
+
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
+ }
+
+ private bool AddArrangeCore(IEnumerable collection)
+ {
+ var itemAdded = false;
+ foreach (var item in collection)
+ {
+ Items.Add(item);
+ itemAdded = true;
+ }
+ return itemAdded;
+ }
+
+ private void RaiseChangeNotificationEvents(NotifyCollectionChangedAction action, List changedItems = null, int startingIndex = -1)
+ {
+ OnPropertyChanged(new PropertyChangedEventArgs(nameof(Count)));
+ OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
+
+ if (changedItems is null)
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(action));
+ else
+ OnCollectionChanged(new NotifyCollectionChangedEventArgs(action, changedItems: changedItems, startingIndex: startingIndex));
}
}
diff --git a/Wino.Core.Domain/Constants.cs b/Wino.Core.Domain/Constants.cs
index f0a3d111..0406edcd 100644
--- a/Wino.Core.Domain/Constants.cs
+++ b/Wino.Core.Domain/Constants.cs
@@ -1,23 +1,22 @@
-namespace Wino.Core.Domain
+namespace Wino.Core.Domain;
+
+public static class Constants
{
- public static class Constants
- {
- ///
- /// MIME header that exists in all the drafts created from Wino.
- ///
- public const string WinoLocalDraftHeader = "X-Wino-Draft-Id";
- public const string LocalDraftStartPrefix = "localDraft_";
+ ///
+ /// MIME header that exists in all the drafts created from Wino.
+ ///
+ public const string WinoLocalDraftHeader = "X-Wino-Draft-Id";
+ public const string LocalDraftStartPrefix = "localDraft_";
- public const string CalendarEventRecurrenceRuleSeperator = "___";
+ public const string CalendarEventRecurrenceRuleSeperator = "___";
- public const string ToastMailUniqueIdKey = nameof(ToastMailUniqueIdKey);
- public const string ToastActionKey = nameof(ToastActionKey);
+ public const string ToastMailUniqueIdKey = nameof(ToastMailUniqueIdKey);
+ public const string ToastActionKey = nameof(ToastActionKey);
- public const string ClientLogFile = "Client_.log";
- public const string ServerLogFile = "Server_.log";
- public const string LogArchiveFileName = "WinoLogs.zip";
+ public const string ClientLogFile = "Client_.log";
+ public const string ServerLogFile = "Server_.log";
+ public const string LogArchiveFileName = "WinoLogs.zip";
- public const string WinoMailIdentiifer = nameof(WinoMailIdentiifer);
- public const string WinoCalendarIdentifier = nameof(WinoCalendarIdentifier);
- }
+ public const string WinoMailIdentiifer = nameof(WinoMailIdentiifer);
+ public const string WinoCalendarIdentifier = nameof(WinoCalendarIdentifier);
}
diff --git a/Wino.Core.Domain/Entities/Calendar/AccountCalendar.cs b/Wino.Core.Domain/Entities/Calendar/AccountCalendar.cs
index 8d7f6218..29a200cf 100644
--- a/Wino.Core.Domain/Entities/Calendar/AccountCalendar.cs
+++ b/Wino.Core.Domain/Entities/Calendar/AccountCalendar.cs
@@ -2,24 +2,23 @@
using SQLite;
using Wino.Core.Domain.Interfaces;
-namespace Wino.Core.Domain.Entities.Calendar
-{
- public class AccountCalendar : IAccountCalendar
- {
- [PrimaryKey]
- public Guid Id { get; set; }
- public Guid AccountId { get; set; }
- public string RemoteCalendarId { get; set; }
- public string SynchronizationDeltaToken { get; set; }
- public string Name { get; set; }
- public bool IsPrimary { get; set; }
- public bool IsExtended { get; set; } = true;
+namespace Wino.Core.Domain.Entities.Calendar;
- ///
- /// Unused for now.
- ///
- public string TextColorHex { get; set; }
- public string BackgroundColorHex { get; set; }
- public string TimeZone { get; set; }
- }
+public class AccountCalendar : IAccountCalendar
+{
+ [PrimaryKey]
+ public Guid Id { get; set; }
+ public Guid AccountId { get; set; }
+ public string RemoteCalendarId { get; set; }
+ public string SynchronizationDeltaToken { get; set; }
+ public string Name { get; set; }
+ public bool IsPrimary { get; set; }
+ public bool IsExtended { get; set; } = true;
+
+ ///
+ /// Unused for now.
+ ///
+ public string TextColorHex { get; set; }
+ public string BackgroundColorHex { get; set; }
+ public string TimeZone { get; set; }
}
diff --git a/Wino.Core.Domain/Entities/Calendar/CalendarEventAttendee.cs b/Wino.Core.Domain/Entities/Calendar/CalendarEventAttendee.cs
index 5fd07479..e9c47da3 100644
--- a/Wino.Core.Domain/Entities/Calendar/CalendarEventAttendee.cs
+++ b/Wino.Core.Domain/Entities/Calendar/CalendarEventAttendee.cs
@@ -2,19 +2,18 @@
using SQLite;
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Entities.Calendar
+namespace Wino.Core.Domain.Entities.Calendar;
+
+// TODO: Connect to Contact store with Wino People.
+public class CalendarEventAttendee
{
- // TODO: Connect to Contact store with Wino People.
- public class CalendarEventAttendee
- {
- [PrimaryKey]
- public Guid Id { get; set; }
- public Guid CalendarItemId { get; set; }
- public string Name { get; set; }
- public string Email { get; set; }
- public AttendeeStatus AttendenceStatus { get; set; }
- public bool IsOrganizer { get; set; }
- public bool IsOptionalAttendee { get; set; }
- public string Comment { get; set; }
- }
+ [PrimaryKey]
+ public Guid Id { get; set; }
+ public Guid CalendarItemId { get; set; }
+ public string Name { get; set; }
+ public string Email { get; set; }
+ public AttendeeStatus AttendenceStatus { get; set; }
+ public bool IsOrganizer { get; set; }
+ public bool IsOptionalAttendee { get; set; }
+ public string Comment { get; set; }
}
diff --git a/Wino.Core.Domain/Entities/Calendar/CalendarItem.cs b/Wino.Core.Domain/Entities/Calendar/CalendarItem.cs
index 022296f8..de03e74e 100644
--- a/Wino.Core.Domain/Entities/Calendar/CalendarItem.cs
+++ b/Wino.Core.Domain/Entities/Calendar/CalendarItem.cs
@@ -5,176 +5,175 @@ using SQLite;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
-namespace Wino.Core.Domain.Entities.Calendar
+namespace Wino.Core.Domain.Entities.Calendar;
+
+[DebuggerDisplay("{Title} ({StartDate} - {EndDate})")]
+public class CalendarItem : ICalendarItem
{
- [DebuggerDisplay("{Title} ({StartDate} - {EndDate})")]
- public class CalendarItem : ICalendarItem
+ [PrimaryKey]
+ public Guid Id { get; set; }
+ public string RemoteEventId { get; set; }
+ public string Title { get; set; }
+ public string Description { get; set; }
+ public string Location { get; set; }
+
+ public DateTime StartDate { get; set; }
+
+ public DateTime EndDate
{
- [PrimaryKey]
- public Guid Id { get; set; }
- public string RemoteEventId { get; set; }
- public string Title { get; set; }
- public string Description { get; set; }
- public string Location { get; set; }
-
- public DateTime StartDate { get; set; }
-
- public DateTime EndDate
+ get
{
- get
- {
- return StartDate.AddSeconds(DurationInSeconds);
- }
- }
-
- public TimeSpan StartDateOffset { get; set; }
- public TimeSpan EndDateOffset { get; set; }
-
- private ITimePeriod _period;
- public ITimePeriod Period
- {
- get
- {
- _period ??= new TimeRange(StartDate, EndDate);
-
- return _period;
- }
- }
-
- ///
- /// Events that starts at midnight and ends at midnight are considered all-day events.
- ///
- public bool IsAllDayEvent
- {
- get
- {
- return
- StartDate.TimeOfDay == TimeSpan.Zero &&
- EndDate.TimeOfDay == TimeSpan.Zero;
- }
- }
-
- ///
- /// Events that are either an exceptional instance of a recurring event or occurrences.
- /// IsOccurrence is used to display occurrence instances of parent recurring events.
- /// IsOccurrence == false && IsRecurringChild == true => exceptional single instance.
- ///
- public bool IsRecurringChild
- {
- get
- {
- return RecurringCalendarItemId != null;
- }
- }
-
- ///
- /// Events that are either an exceptional instance of a recurring event or occurrences.
- ///
- public bool IsRecurringEvent => IsRecurringChild || IsRecurringParent;
-
- ///
- /// Events that are the master event definition of recurrence events.
- ///
- public bool IsRecurringParent
- {
- get
- {
- return !string.IsNullOrEmpty(Recurrence) && RecurringCalendarItemId == null;
- }
- }
-
- ///
- /// Events that are not all-day events and last more than one day are considered multi-day events.
- ///
- public bool IsMultiDayEvent
- {
- get
- {
- return Period.Duration.TotalDays >= 1 && !IsAllDayEvent;
- }
- }
-
- public double DurationInSeconds { get; set; }
- public string Recurrence { get; set; }
-
- public string OrganizerDisplayName { get; set; }
- public string OrganizerEmail { get; set; }
-
- ///
- /// The id of the parent calendar item of the recurring event.
- /// Exceptional instances are stored as a separate calendar item.
- /// This makes the calendar item a child of the recurring event.
- ///
- public Guid? RecurringCalendarItemId { get; set; }
-
- ///
- /// Indicates read-only events. Default is false.
- ///
- public bool IsLocked { get; set; }
-
- ///
- /// Hidden events must not be displayed to the user.
- /// This usually happens when a child instance of recurring parent is cancelled after creation.
- ///
- public bool IsHidden { get; set; }
-
- // TODO
- public string CustomEventColorHex { get; set; }
- public string HtmlLink { get; set; }
- public CalendarItemStatus Status { get; set; }
- public CalendarItemVisibility Visibility { get; set; }
- public DateTimeOffset CreatedAt { get; set; }
- public DateTimeOffset UpdatedAt { get; set; }
- public Guid CalendarId { get; set; }
-
- [Ignore]
- public IAccountCalendar AssignedCalendar { get; set; }
-
- ///
- /// Whether this item does not really exist in the database or not.
- /// These are used to display occurrence instances of parent recurring events.
- ///
- [Ignore]
- public bool IsOccurrence { get; set; }
-
- ///
- /// Id to load information related to this event.
- /// Occurrences tracked by the parent recurring event if they are not exceptional instances.
- /// Recurring children here are exceptional instances. They have their own info in the database including Id.
- ///
- public Guid EventTrackingId => IsOccurrence ? RecurringCalendarItemId.Value : Id;
-
- public CalendarItem CreateRecurrence(DateTime startDate, double durationInSeconds)
- {
- // Create a copy with the new start date and duration
-
- return new CalendarItem
- {
- Id = Guid.NewGuid(),
- Title = Title,
- Description = Description,
- Location = Location,
- StartDate = startDate,
- DurationInSeconds = durationInSeconds,
- Recurrence = Recurrence,
- OrganizerDisplayName = OrganizerDisplayName,
- OrganizerEmail = OrganizerEmail,
- RecurringCalendarItemId = Id,
- AssignedCalendar = AssignedCalendar,
- CalendarId = CalendarId,
- CreatedAt = CreatedAt,
- UpdatedAt = UpdatedAt,
- Visibility = Visibility,
- Status = Status,
- CustomEventColorHex = CustomEventColorHex,
- HtmlLink = HtmlLink,
- StartDateOffset = StartDateOffset,
- EndDateOffset = EndDateOffset,
- RemoteEventId = RemoteEventId,
- IsHidden = IsHidden,
- IsLocked = IsLocked,
- IsOccurrence = true
- };
+ return StartDate.AddSeconds(DurationInSeconds);
}
}
+
+ public TimeSpan StartDateOffset { get; set; }
+ public TimeSpan EndDateOffset { get; set; }
+
+ private ITimePeriod _period;
+ public ITimePeriod Period
+ {
+ get
+ {
+ _period ??= new TimeRange(StartDate, EndDate);
+
+ return _period;
+ }
+ }
+
+ ///
+ /// Events that starts at midnight and ends at midnight are considered all-day events.
+ ///
+ public bool IsAllDayEvent
+ {
+ get
+ {
+ return
+ StartDate.TimeOfDay == TimeSpan.Zero &&
+ EndDate.TimeOfDay == TimeSpan.Zero;
+ }
+ }
+
+ ///
+ /// Events that are either an exceptional instance of a recurring event or occurrences.
+ /// IsOccurrence is used to display occurrence instances of parent recurring events.
+ /// IsOccurrence == false && IsRecurringChild == true => exceptional single instance.
+ ///
+ public bool IsRecurringChild
+ {
+ get
+ {
+ return RecurringCalendarItemId != null;
+ }
+ }
+
+ ///
+ /// Events that are either an exceptional instance of a recurring event or occurrences.
+ ///
+ public bool IsRecurringEvent => IsRecurringChild || IsRecurringParent;
+
+ ///
+ /// Events that are the master event definition of recurrence events.
+ ///
+ public bool IsRecurringParent
+ {
+ get
+ {
+ return !string.IsNullOrEmpty(Recurrence) && RecurringCalendarItemId == null;
+ }
+ }
+
+ ///
+ /// Events that are not all-day events and last more than one day are considered multi-day events.
+ ///
+ public bool IsMultiDayEvent
+ {
+ get
+ {
+ return Period.Duration.TotalDays >= 1 && !IsAllDayEvent;
+ }
+ }
+
+ public double DurationInSeconds { get; set; }
+ public string Recurrence { get; set; }
+
+ public string OrganizerDisplayName { get; set; }
+ public string OrganizerEmail { get; set; }
+
+ ///
+ /// The id of the parent calendar item of the recurring event.
+ /// Exceptional instances are stored as a separate calendar item.
+ /// This makes the calendar item a child of the recurring event.
+ ///
+ public Guid? RecurringCalendarItemId { get; set; }
+
+ ///
+ /// Indicates read-only events. Default is false.
+ ///
+ public bool IsLocked { get; set; }
+
+ ///
+ /// Hidden events must not be displayed to the user.
+ /// This usually happens when a child instance of recurring parent is cancelled after creation.
+ ///
+ public bool IsHidden { get; set; }
+
+ // TODO
+ public string CustomEventColorHex { get; set; }
+ public string HtmlLink { get; set; }
+ public CalendarItemStatus Status { get; set; }
+ public CalendarItemVisibility Visibility { get; set; }
+ public DateTimeOffset CreatedAt { get; set; }
+ public DateTimeOffset UpdatedAt { get; set; }
+ public Guid CalendarId { get; set; }
+
+ [Ignore]
+ public IAccountCalendar AssignedCalendar { get; set; }
+
+ ///
+ /// Whether this item does not really exist in the database or not.
+ /// These are used to display occurrence instances of parent recurring events.
+ ///
+ [Ignore]
+ public bool IsOccurrence { get; set; }
+
+ ///
+ /// Id to load information related to this event.
+ /// Occurrences tracked by the parent recurring event if they are not exceptional instances.
+ /// Recurring children here are exceptional instances. They have their own info in the database including Id.
+ ///
+ public Guid EventTrackingId => IsOccurrence ? RecurringCalendarItemId.Value : Id;
+
+ public CalendarItem CreateRecurrence(DateTime startDate, double durationInSeconds)
+ {
+ // Create a copy with the new start date and duration
+
+ return new CalendarItem
+ {
+ Id = Guid.NewGuid(),
+ Title = Title,
+ Description = Description,
+ Location = Location,
+ StartDate = startDate,
+ DurationInSeconds = durationInSeconds,
+ Recurrence = Recurrence,
+ OrganizerDisplayName = OrganizerDisplayName,
+ OrganizerEmail = OrganizerEmail,
+ RecurringCalendarItemId = Id,
+ AssignedCalendar = AssignedCalendar,
+ CalendarId = CalendarId,
+ CreatedAt = CreatedAt,
+ UpdatedAt = UpdatedAt,
+ Visibility = Visibility,
+ Status = Status,
+ CustomEventColorHex = CustomEventColorHex,
+ HtmlLink = HtmlLink,
+ StartDateOffset = StartDateOffset,
+ EndDateOffset = EndDateOffset,
+ RemoteEventId = RemoteEventId,
+ IsHidden = IsHidden,
+ IsLocked = IsLocked,
+ IsOccurrence = true
+ };
+ }
}
diff --git a/Wino.Core.Domain/Entities/Calendar/Reminder.cs b/Wino.Core.Domain/Entities/Calendar/Reminder.cs
index 64c3b65c..3dc64b81 100644
--- a/Wino.Core.Domain/Entities/Calendar/Reminder.cs
+++ b/Wino.Core.Domain/Entities/Calendar/Reminder.cs
@@ -2,15 +2,14 @@
using SQLite;
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Entities.Calendar
-{
- public class Reminder
- {
- [PrimaryKey]
- public Guid Id { get; set; }
- public Guid CalendarItemId { get; set; }
+namespace Wino.Core.Domain.Entities.Calendar;
- public DateTimeOffset ReminderTime { get; set; }
- public CalendarItemReminderType ReminderType { get; set; }
- }
+public class Reminder
+{
+ [PrimaryKey]
+ public Guid Id { get; set; }
+ public Guid CalendarItemId { get; set; }
+
+ public DateTimeOffset ReminderTime { get; set; }
+ public CalendarItemReminderType ReminderType { get; set; }
}
diff --git a/Wino.Core.Domain/Entities/Mail/AccountSignature.cs b/Wino.Core.Domain/Entities/Mail/AccountSignature.cs
index fa867d7e..fb1066b6 100644
--- a/Wino.Core.Domain/Entities/Mail/AccountSignature.cs
+++ b/Wino.Core.Domain/Entities/Mail/AccountSignature.cs
@@ -1,17 +1,16 @@
using System;
using SQLite;
-namespace Wino.Core.Domain.Entities.Mail
+namespace Wino.Core.Domain.Entities.Mail;
+
+public class AccountSignature
{
- public class AccountSignature
- {
- [PrimaryKey]
- public Guid Id { get; set; }
+ [PrimaryKey]
+ public Guid Id { get; set; }
- public string Name { get; set; }
+ public string Name { get; set; }
- public string HtmlBody { get; set; }
+ public string HtmlBody { get; set; }
- public Guid MailAccountId { get; set; }
- }
+ public Guid MailAccountId { get; set; }
}
diff --git a/Wino.Core.Domain/Entities/Mail/MailAccountAlias.cs b/Wino.Core.Domain/Entities/Mail/MailAccountAlias.cs
index 0860ecf6..f13dd5ef 100644
--- a/Wino.Core.Domain/Entities/Mail/MailAccountAlias.cs
+++ b/Wino.Core.Domain/Entities/Mail/MailAccountAlias.cs
@@ -1,63 +1,62 @@
using System;
using SQLite;
-namespace Wino.Core.Domain.Entities.Mail
+namespace Wino.Core.Domain.Entities.Mail;
+
+public class RemoteAccountAlias
{
- public class RemoteAccountAlias
- {
- ///
- /// Display address of the alias.
- ///
- public string AliasAddress { get; set; }
+ ///
+ /// Display address of the alias.
+ ///
+ public string AliasAddress { get; set; }
- ///
- /// Address to be included in Reply-To header when alias is used for sending messages.
- ///
- public string ReplyToAddress { get; set; }
+ ///
+ /// Address to be included in Reply-To header when alias is used for sending messages.
+ ///
+ public string ReplyToAddress { get; set; }
- ///
- /// Whether this alias is the primary alias for the account.
- ///
- public bool IsPrimary { get; set; }
+ ///
+ /// Whether this alias is the primary alias for the account.
+ ///
+ public bool IsPrimary { get; set; }
- ///
- /// Whether the alias is verified by the server.
- /// Only Gmail aliases are verified for now.
- /// Non-verified alias messages might be rejected by SMTP server.
- ///
- public bool IsVerified { get; set; }
+ ///
+ /// Whether the alias is verified by the server.
+ /// Only Gmail aliases are verified for now.
+ /// Non-verified alias messages might be rejected by SMTP server.
+ ///
+ public bool IsVerified { get; set; }
- ///
- /// Whether this alias is the root alias for the account.
- /// Root alias means the first alias that was created for the account.
- /// It can't be deleted or changed.
- ///
- public bool IsRootAlias { get; set; }
+ ///
+ /// Whether this alias is the root alias for the account.
+ /// Root alias means the first alias that was created for the account.
+ /// It can't be deleted or changed.
+ ///
+ public bool IsRootAlias { get; set; }
- ///
- /// Optional sender name for the alias.
- /// Falls back to account's sender name if not set when preparing messages.
- /// Used for Gmail only.
- ///
- public string AliasSenderName { get; set; }
- }
-
- public class MailAccountAlias : RemoteAccountAlias
- {
- ///
- /// Unique Id for the alias.
- ///
- [PrimaryKey]
- public Guid Id { get; set; }
-
- ///
- /// Account id that this alias is attached to.
- ///
- public Guid AccountId { get; set; }
-
- ///
- /// Root aliases can't be deleted.
- ///
- public bool CanDelete => !IsRootAlias;
- }
+ ///
+ /// Optional sender name for the alias.
+ /// Falls back to account's sender name if not set when preparing messages.
+ /// Used for Gmail only.
+ ///
+ public string AliasSenderName { get; set; }
+}
+
+public class MailAccountAlias : RemoteAccountAlias
+{
+ ///
+ /// Unique Id for the alias.
+ ///
+ [PrimaryKey]
+ public Guid Id { get; set; }
+
+ ///
+ /// Account id that this alias is attached to.
+ ///
+ public Guid AccountId { get; set; }
+
+ ///
+ /// Root aliases can't be deleted.
+ ///
+ public bool CanDelete => !IsRootAlias;
}
diff --git a/Wino.Core.Domain/Entities/Mail/MailCopy.cs b/Wino.Core.Domain/Entities/Mail/MailCopy.cs
index b0b9d208..b3c1049d 100644
--- a/Wino.Core.Domain/Entities/Mail/MailCopy.cs
+++ b/Wino.Core.Domain/Entities/Mail/MailCopy.cs
@@ -5,153 +5,152 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.MailItem;
-namespace Wino.Core.Domain.Entities.Mail
+namespace Wino.Core.Domain.Entities.Mail;
+
+///
+/// Summary of the parsed MIME messages.
+/// Wino will do non-network operations on this table and others from the original MIME.
+///
+public class MailCopy : IMailItem
{
///
- /// Summary of the parsed MIME messages.
- /// Wino will do non-network operations on this table and others from the original MIME.
+ /// Unique Id of the mail.
///
- public class MailCopy : IMailItem
- {
- ///
- /// Unique Id of the mail.
- ///
- [PrimaryKey]
- public Guid UniqueId { get; set; }
+ [PrimaryKey]
+ public Guid UniqueId { get; set; }
- ///
- /// Not unique id of the item. Some operations held on this Id, some on the UniqueId.
- /// Same message can be in different folder. In that case UniqueId is used.
- ///
- public string Id { get; set; }
+ ///
+ /// Not unique id of the item. Some operations held on this Id, some on the UniqueId.
+ /// Same message can be in different folder. In that case UniqueId is used.
+ ///
+ public string Id { get; set; }
- ///
- /// Folder that this mail belongs to.
- ///
- public Guid FolderId { get; set; }
+ ///
+ /// Folder that this mail belongs to.
+ ///
+ public Guid FolderId { get; set; }
- ///
- /// Conversation id for the mail.
- ///
- public string ThreadId { get; set; }
+ ///
+ /// Conversation id for the mail.
+ ///
+ public string ThreadId { get; set; }
- ///
- /// MIME MessageId if exists.
- ///
- public string MessageId { get; set; }
+ ///
+ /// MIME MessageId if exists.
+ ///
+ public string MessageId { get; set; }
- ///
- /// References header from MIME
- ///
- public string References { get; set; }
+ ///
+ /// References header from MIME
+ ///
+ public string References { get; set; }
- ///
- /// In-Reply-To header from MIME
- ///
- public string InReplyTo { get; set; }
+ ///
+ /// In-Reply-To header from MIME
+ ///
+ public string InReplyTo { get; set; }
- ///
- /// Name for the sender.
- ///
- public string FromName { get; set; }
+ ///
+ /// Name for the sender.
+ ///
+ public string FromName { get; set; }
- ///
- /// Address of the sender.
- ///
- public string FromAddress { get; set; }
+ ///
+ /// Address of the sender.
+ ///
+ public string FromAddress { get; set; }
- ///
- /// Subject of the mail.
- ///
- public string Subject { get; set; }
+ ///
+ /// Subject of the mail.
+ ///
+ public string Subject { get; set; }
- ///
- /// Short preview of the content.
- ///
- public string PreviewText { get; set; }
+ ///
+ /// Short preview of the content.
+ ///
+ public string PreviewText { get; set; }
- ///
- /// Date that represents this mail has been created in provider servers.
- /// Stored always in UTC.
- ///
- public DateTime CreationDate { get; set; }
+ ///
+ /// Date that represents this mail has been created in provider servers.
+ /// Stored always in UTC.
+ ///
+ public DateTime CreationDate { get; set; }
- ///
- /// Importance of the mail.
- ///
- public MailImportance Importance { get; set; }
+ ///
+ /// Importance of the mail.
+ ///
+ public MailImportance Importance { get; set; }
- ///
- /// Read status for the mail.
- ///
- public bool IsRead { get; set; }
+ ///
+ /// Read status for the mail.
+ ///
+ public bool IsRead { get; set; }
- ///
- /// Flag status.
- /// Flagged for Outlook.
- /// Important for Gmail.
- ///
- public bool IsFlagged { get; set; }
+ ///
+ /// Flag status.
+ /// Flagged for Outlook.
+ /// Important for Gmail.
+ ///
+ public bool IsFlagged { get; set; }
- ///
- /// To support Outlook.
- /// Gmail doesn't use it.
- ///
- public bool IsFocused { get; set; }
+ ///
+ /// To support Outlook.
+ /// Gmail doesn't use it.
+ ///
+ public bool IsFocused { get; set; }
- ///
- /// Whether mail has attachments included or not.
- ///
- public bool HasAttachments { get; set; }
+ ///
+ /// Whether mail has attachments included or not.
+ ///
+ public bool HasAttachments { get; set; }
- ///
- /// Assigned draft id.
- ///
- public string DraftId { get; set; }
+ ///
+ /// Assigned draft id.
+ ///
+ public string DraftId { get; set; }
- ///
- /// Whether this mail is only created locally.
- ///
- [Ignore]
- public bool IsLocalDraft => !string.IsNullOrEmpty(DraftId) && DraftId.StartsWith(Constants.LocalDraftStartPrefix);
+ ///
+ /// Whether this mail is only created locally.
+ ///
+ [Ignore]
+ public bool IsLocalDraft => !string.IsNullOrEmpty(DraftId) && DraftId.StartsWith(Constants.LocalDraftStartPrefix);
- ///
- /// Whether this copy is draft or not.
- ///
- public bool IsDraft { get; set; }
+ ///
+ /// Whether this copy is draft or not.
+ ///
+ public bool IsDraft { get; set; }
- ///
- /// File id that this mail is assigned to.
- /// This Id is immutable. It's used to find the file in the file system.
- /// Even after mapping local draft to remote draft, it will not change.
- ///
- public Guid FileId { get; set; }
+ ///
+ /// File id that this mail is assigned to.
+ /// This Id is immutable. It's used to find the file in the file system.
+ /// Even after mapping local draft to remote draft, it will not change.
+ ///
+ public Guid FileId { get; set; }
- ///
- /// Folder that this mail is assigned to.
- /// Warning: This field is not populated by queries.
- /// Services or View Models are responsible for populating this field.
- ///
- [Ignore]
- public MailItemFolder AssignedFolder { get; set; }
+ ///
+ /// Folder that this mail is assigned to.
+ /// Warning: This field is not populated by queries.
+ /// Services or View Models are responsible for populating this field.
+ ///
+ [Ignore]
+ public MailItemFolder AssignedFolder { get; set; }
- ///
- /// Account that this mail is assigned to.
- /// Warning: This field is not populated by queries.
- /// Services or View Models are responsible for populating this field.
- ///
- [Ignore]
- public MailAccount AssignedAccount { get; set; }
+ ///
+ /// Account that this mail is assigned to.
+ /// Warning: This field is not populated by queries.
+ /// Services or View Models are responsible for populating this field.
+ ///
+ [Ignore]
+ public MailAccount AssignedAccount { get; set; }
- ///
- /// Contact information of the sender if exists.
- /// Warning: This field is not populated by queries.
- /// Services or View Models are responsible for populating this field.
- ///
- [Ignore]
- public AccountContact SenderContact { get; set; }
+ ///
+ /// Contact information of the sender if exists.
+ /// Warning: This field is not populated by queries.
+ /// Services or View Models are responsible for populating this field.
+ ///
+ [Ignore]
+ public AccountContact SenderContact { get; set; }
- public IEnumerable GetContainingIds() => [UniqueId];
- public override string ToString() => $"{Subject} <-> {Id}";
- }
+ public IEnumerable GetContainingIds() => [UniqueId];
+ public override string ToString() => $"{Subject} <-> {Id}";
}
diff --git a/Wino.Core.Domain/Entities/Mail/MailItemFolder.cs b/Wino.Core.Domain/Entities/Mail/MailItemFolder.cs
index 62e13796..bb1a2cae 100644
--- a/Wino.Core.Domain/Entities/Mail/MailItemFolder.cs
+++ b/Wino.Core.Domain/Entities/Mail/MailItemFolder.cs
@@ -5,71 +5,70 @@ using SQLite;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
-namespace Wino.Core.Domain.Entities.Mail
+namespace Wino.Core.Domain.Entities.Mail;
+
+[DebuggerDisplay("{FolderName} - {SpecialFolderType}")]
+public class MailItemFolder : IMailItemFolder
{
- [DebuggerDisplay("{FolderName} - {SpecialFolderType}")]
- public class MailItemFolder : IMailItemFolder
+ [PrimaryKey]
+ public Guid Id { get; set; }
+
+ public string RemoteFolderId { get; set; }
+ public string ParentRemoteFolderId { get; set; }
+
+ public Guid MailAccountId { get; set; }
+ public string FolderName { get; set; }
+ public SpecialFolderType SpecialFolderType { get; set; }
+ public bool IsSystemFolder { get; set; }
+ public bool IsSticky { get; set; }
+ public bool IsSynchronizationEnabled { get; set; }
+ public bool IsHidden { get; set; }
+ public bool ShowUnreadCount { get; set; }
+ public DateTime? LastSynchronizedDate { get; set; }
+
+ // For IMAP
+ public uint UidValidity { get; set; }
+ public long HighestModeSeq { get; set; }
+
+ ///
+ /// Outlook shares delta changes per-folder. Gmail is for per-account.
+ /// This is only used for Outlook provider.
+ ///
+ public string DeltaToken { get; set; }
+
+ // For GMail Labels
+ public string TextColorHex { get; set; }
+ public string BackgroundColorHex { get; set; }
+
+ [Ignore]
+ public List ChildFolders { get; set; } = [];
+
+ // Category and Move type folders are not valid move targets.
+ // These folders are virtual. They don't exist on the server.
+ public bool IsMoveTarget => !(SpecialFolderType == SpecialFolderType.More || SpecialFolderType == SpecialFolderType.Category);
+
+ public bool ContainsSpecialFolderType(SpecialFolderType type)
{
- [PrimaryKey]
- public Guid Id { get; set; }
+ if (SpecialFolderType == type)
+ return true;
- public string RemoteFolderId { get; set; }
- public string ParentRemoteFolderId { get; set; }
-
- public Guid MailAccountId { get; set; }
- public string FolderName { get; set; }
- public SpecialFolderType SpecialFolderType { get; set; }
- public bool IsSystemFolder { get; set; }
- public bool IsSticky { get; set; }
- public bool IsSynchronizationEnabled { get; set; }
- public bool IsHidden { get; set; }
- public bool ShowUnreadCount { get; set; }
- public DateTime? LastSynchronizedDate { get; set; }
-
- // For IMAP
- public uint UidValidity { get; set; }
- public long HighestModeSeq { get; set; }
-
- ///
- /// Outlook shares delta changes per-folder. Gmail is for per-account.
- /// This is only used for Outlook provider.
- ///
- public string DeltaToken { get; set; }
-
- // For GMail Labels
- public string TextColorHex { get; set; }
- public string BackgroundColorHex { get; set; }
-
- [Ignore]
- public List ChildFolders { get; set; } = [];
-
- // Category and Move type folders are not valid move targets.
- // These folders are virtual. They don't exist on the server.
- public bool IsMoveTarget => !(SpecialFolderType == SpecialFolderType.More || SpecialFolderType == SpecialFolderType.Category);
-
- public bool ContainsSpecialFolderType(SpecialFolderType type)
+ foreach (var child in ChildFolders)
{
- if (SpecialFolderType == type)
- return true;
-
- foreach (var child in ChildFolders)
+ if (child.SpecialFolderType == type)
{
- if (child.SpecialFolderType == type)
- {
- return true;
- }
- else
- {
- return child.ContainsSpecialFolderType(type);
- }
+ return true;
+ }
+ else
+ {
+ return child.ContainsSpecialFolderType(type);
}
-
- return false;
}
- public static MailItemFolder CreateMoreFolder() => new MailItemFolder() { IsSticky = true, SpecialFolderType = SpecialFolderType.More, FolderName = Translator.MoreFolderNameOverride };
- public static MailItemFolder CreateCategoriesFolder() => new MailItemFolder() { IsSticky = true, SpecialFolderType = SpecialFolderType.Category, FolderName = Translator.CategoriesFolderNameOverride };
-
- public override string ToString() => FolderName;
+ return false;
}
+
+ public static MailItemFolder CreateMoreFolder() => new MailItemFolder() { IsSticky = true, SpecialFolderType = SpecialFolderType.More, FolderName = Translator.MoreFolderNameOverride };
+ public static MailItemFolder CreateCategoriesFolder() => new MailItemFolder() { IsSticky = true, SpecialFolderType = SpecialFolderType.Category, FolderName = Translator.CategoriesFolderNameOverride };
+
+ public override string ToString() => FolderName;
}
diff --git a/Wino.Core.Domain/Entities/Mail/MergedInbox.cs b/Wino.Core.Domain/Entities/Mail/MergedInbox.cs
index f0811c96..446a6b55 100644
--- a/Wino.Core.Domain/Entities/Mail/MergedInbox.cs
+++ b/Wino.Core.Domain/Entities/Mail/MergedInbox.cs
@@ -1,13 +1,12 @@
using System;
using SQLite;
-namespace Wino.Core.Domain.Entities.Mail
-{
- public class MergedInbox
- {
- [PrimaryKey]
- public Guid Id { get; set; }
+namespace Wino.Core.Domain.Entities.Mail;
- public string Name { get; set; }
- }
+public class MergedInbox
+{
+ [PrimaryKey]
+ public Guid Id { get; set; }
+
+ public string Name { get; set; }
}
diff --git a/Wino.Core.Domain/Entities/Shared/AccountContact.cs b/Wino.Core.Domain/Entities/Shared/AccountContact.cs
index 6679ca2f..9b2eae37 100644
--- a/Wino.Core.Domain/Entities/Shared/AccountContact.cs
+++ b/Wino.Core.Domain/Entities/Shared/AccountContact.cs
@@ -2,76 +2,75 @@
using System.Collections.Generic;
using SQLite;
-namespace Wino.Core.Domain.Entities.Shared
+namespace Wino.Core.Domain.Entities.Shared;
+
+///
+/// Back storage for simple name-address book.
+/// These values will be inserted during MIME fetch.
+///
+
+// TODO: This can easily evolve to Contact store, just like People app in Windows 10/11.
+// Do it.
+public class AccountContact : IEquatable
{
///
- /// Back storage for simple name-address book.
- /// These values will be inserted during MIME fetch.
+ /// E-mail address of the contact.
///
+ [PrimaryKey]
+ public string Address { get; set; }
- // TODO: This can easily evolve to Contact store, just like People app in Windows 10/11.
- // Do it.
- public class AccountContact : IEquatable
+ ///
+ /// Display name of the contact.
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// Base64 encoded profile image of the contact.
+ ///
+ public string Base64ContactPicture { get; set; }
+
+ ///
+ /// All registered accounts have their contacts registered as root.
+ /// Root contacts must not be overridden by any configuration.
+ /// They are created on account creation.
+ ///
+ public bool IsRootContact { get; set; }
+
+ ///
+ /// Short display name of the contact.
+ /// Eather Name or Address.
+ ///
+ public string ShortDisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? $"{Address.ToLowerInvariant()};" : $"{Name};";
+
+ public string DisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? Address.ToLowerInvariant() : $"{Name} <{Address.ToLowerInvariant()}>";
+
+ public override bool Equals(object obj)
{
- ///
- /// E-mail address of the contact.
- ///
- [PrimaryKey]
- public string Address { get; set; }
+ return Equals(obj as AccountContact);
+ }
- ///
- /// Display name of the contact.
- ///
- public string Name { get; set; }
+ public bool Equals(AccountContact other)
+ {
+ return other is not null &&
+ Address == other.Address &&
+ Name == other.Name;
+ }
- ///
- /// Base64 encoded profile image of the contact.
- ///
- public string Base64ContactPicture { get; set; }
+ public override int GetHashCode()
+ {
+ int hashCode = -1717786383;
+ hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Address);
+ hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name);
+ return hashCode;
+ }
- ///
- /// All registered accounts have their contacts registered as root.
- /// Root contacts must not be overridden by any configuration.
- /// They are created on account creation.
- ///
- public bool IsRootContact { get; set; }
+ public static bool operator ==(AccountContact left, AccountContact right)
+ {
+ return EqualityComparer.Default.Equals(left, right);
+ }
- ///
- /// Short display name of the contact.
- /// Eather Name or Address.
- ///
- public string ShortDisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? $"{Address.ToLowerInvariant()};" : $"{Name};";
-
- public string DisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? Address.ToLowerInvariant() : $"{Name} <{Address.ToLowerInvariant()}>";
-
- public override bool Equals(object obj)
- {
- return Equals(obj as AccountContact);
- }
-
- public bool Equals(AccountContact other)
- {
- return other is not null &&
- Address == other.Address &&
- Name == other.Name;
- }
-
- public override int GetHashCode()
- {
- int hashCode = -1717786383;
- hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Address);
- hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Name);
- return hashCode;
- }
-
- public static bool operator ==(AccountContact left, AccountContact right)
- {
- return EqualityComparer.Default.Equals(left, right);
- }
-
- public static bool operator !=(AccountContact left, AccountContact right)
- {
- return !(left == right);
- }
+ public static bool operator !=(AccountContact left, AccountContact right)
+ {
+ return !(left == right);
}
}
diff --git a/Wino.Core.Domain/Entities/Shared/CustomServerInformation.cs b/Wino.Core.Domain/Entities/Shared/CustomServerInformation.cs
index 630a79c7..164027c7 100644
--- a/Wino.Core.Domain/Entities/Shared/CustomServerInformation.cs
+++ b/Wino.Core.Domain/Entities/Shared/CustomServerInformation.cs
@@ -2,52 +2,51 @@
using SQLite;
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Entities.Shared
+namespace Wino.Core.Domain.Entities.Shared;
+
+public class CustomServerInformation
{
- public class CustomServerInformation
- {
- [PrimaryKey]
- public Guid Id { get; set; }
+ [PrimaryKey]
+ public Guid Id { get; set; }
- public Guid AccountId { get; set; }
+ public Guid AccountId { get; set; }
- ///
- /// This field is ignored. DisplayName is stored in MailAccount as SenderName from now.
- ///
- [Ignore]
- public string DisplayName { get; set; }
- public string Address { get; set; }
- public string IncomingServer { get; set; }
- public string IncomingServerUsername { get; set; }
- public string IncomingServerPassword { get; set; }
- public string IncomingServerPort { get; set; }
+ ///
+ /// This field is ignored. DisplayName is stored in MailAccount as SenderName from now.
+ ///
+ [Ignore]
+ public string DisplayName { get; set; }
+ public string Address { get; set; }
+ public string IncomingServer { get; set; }
+ public string IncomingServerUsername { get; set; }
+ public string IncomingServerPassword { get; set; }
+ public string IncomingServerPort { get; set; }
- public CustomIncomingServerType IncomingServerType { get; set; }
+ public CustomIncomingServerType IncomingServerType { get; set; }
- public string OutgoingServer { get; set; }
- public string OutgoingServerPort { get; set; }
- public string OutgoingServerUsername { get; set; }
- public string OutgoingServerPassword { get; set; }
+ public string OutgoingServer { get; set; }
+ public string OutgoingServerPort { get; set; }
+ public string OutgoingServerUsername { get; set; }
+ public string OutgoingServerPassword { get; set; }
- ///
- /// useSSL True: SslOnConnect
- /// useSSL False: StartTlsWhenAvailable
- ///
+ ///
+ /// useSSL True: SslOnConnect
+ /// useSSL False: StartTlsWhenAvailable
+ ///
- public ImapConnectionSecurity IncomingServerSocketOption { get; set; }
- public ImapAuthenticationMethod IncomingAuthenticationMethod { get; set; }
+ public ImapConnectionSecurity IncomingServerSocketOption { get; set; }
+ public ImapAuthenticationMethod IncomingAuthenticationMethod { get; set; }
- public ImapConnectionSecurity OutgoingServerSocketOption { get; set; }
- public ImapAuthenticationMethod OutgoingAuthenticationMethod { get; set; }
+ public ImapConnectionSecurity OutgoingServerSocketOption { get; set; }
+ public ImapAuthenticationMethod OutgoingAuthenticationMethod { get; set; }
- public string ProxyServer { get; set; }
- public string ProxyServerPort { get; set; }
+ public string ProxyServer { get; set; }
+ public string ProxyServerPort { get; set; }
- ///
- /// Number of concurrent clients that can connect to the server.
- /// Default is 5.
- ///
- public int MaxConcurrentClients { get; set; }
- }
+ ///
+ /// Number of concurrent clients that can connect to the server.
+ /// Default is 5.
+ ///
+ public int MaxConcurrentClients { get; set; }
}
diff --git a/Wino.Core.Domain/Entities/Shared/MailAccount.cs b/Wino.Core.Domain/Entities/Shared/MailAccount.cs
index 20c2a304..8f40f70d 100644
--- a/Wino.Core.Domain/Entities/Shared/MailAccount.cs
+++ b/Wino.Core.Domain/Entities/Shared/MailAccount.cs
@@ -3,109 +3,108 @@ using SQLite;
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Entities.Shared
+namespace Wino.Core.Domain.Entities.Shared;
+
+public class MailAccount
{
- public class MailAccount
- {
- [PrimaryKey]
- public Guid Id { get; set; }
+ [PrimaryKey]
+ public Guid Id { get; set; }
- ///
- /// Given name of the account in Wino.
- ///
- public string Name { get; set; }
+ ///
+ /// Given name of the account in Wino.
+ ///
+ public string Name { get; set; }
- ///
- /// TODO: Display name of the authenticated user/account.
- /// API integrations will query this value from the API.
- /// IMAP is populated by user on setup dialog.
- ///
+ ///
+ /// TODO: Display name of the authenticated user/account.
+ /// API integrations will query this value from the API.
+ /// IMAP is populated by user on setup dialog.
+ ///
- public string SenderName { get; set; }
+ public string SenderName { get; set; }
- ///
- /// Account e-mail address.
- ///
- public string Address { get; set; }
+ ///
+ /// Account e-mail address.
+ ///
+ public string Address { get; set; }
- ///
- /// Provider type of the account. Outlook,Gmail etc...
- ///
- public MailProviderType ProviderType { get; set; }
+ ///
+ /// Provider type of the account. Outlook,Gmail etc...
+ ///
+ public MailProviderType ProviderType { get; set; }
- ///
- /// For tracking mail change delta.
- /// Gmail : historyId
- /// Outlook: deltaToken
- ///
- public string SynchronizationDeltaIdentifier { get; set; }
+ ///
+ /// For tracking mail change delta.
+ /// Gmail : historyId
+ /// Outlook: deltaToken
+ ///
+ public string SynchronizationDeltaIdentifier { get; set; }
- ///
- /// For tracking calendar change delta.
- /// Gmail: It's per-calendar, so unused.
- /// Outlook: deltaLink
- ///
- public string CalendarSynchronizationDeltaIdentifier { get; set; }
+ ///
+ /// For tracking calendar change delta.
+ /// Gmail: It's per-calendar, so unused.
+ /// Outlook: deltaLink
+ ///
+ public string CalendarSynchronizationDeltaIdentifier { get; set; }
- ///
- /// TODO: Gets or sets the custom account identifier color in hex.
- ///
- public string AccountColorHex { get; set; }
+ ///
+ /// TODO: Gets or sets the custom account identifier color in hex.
+ ///
+ public string AccountColorHex { get; set; }
- ///
- /// Base64 encoded profile picture of the account.
- ///
- public string Base64ProfilePictureData { get; set; }
+ ///
+ /// Base64 encoded profile picture of the account.
+ ///
+ public string Base64ProfilePictureData { get; set; }
- ///
- /// Gets or sets the listing order of the account in the accounts list.
- ///
- public int Order { get; set; }
+ ///
+ /// Gets or sets the listing order of the account in the accounts list.
+ ///
+ public int Order { get; set; }
- ///
- /// Gets or sets whether the account has any reason for an interactive user action to fix continue operating.
- ///
- public AccountAttentionReason AttentionReason { get; set; }
+ ///
+ /// Gets or sets whether the account has any reason for an interactive user action to fix continue operating.
+ ///
+ public AccountAttentionReason AttentionReason { get; set; }
- ///
- /// Gets or sets the id of the merged inbox this account belongs to.
- ///
- public Guid? MergedInboxId { get; set; }
+ ///
+ /// Gets or sets the id of the merged inbox this account belongs to.
+ ///
+ public Guid? MergedInboxId { get; set; }
- ///
- /// Gets or sets the additional IMAP provider assignment for the account.
- /// Providers that use IMAP as a synchronizer but have special requirements.
- ///
- public SpecialImapProvider SpecialImapProvider { get; set; }
+ ///
+ /// Gets or sets the additional IMAP provider assignment for the account.
+ /// Providers that use IMAP as a synchronizer but have special requirements.
+ ///
+ public SpecialImapProvider SpecialImapProvider { get; set; }
- ///
- /// Contains the merged inbox this account belongs to.
- /// Ignored for all SQLite operations.
- ///
- [Ignore]
- public MergedInbox MergedInbox { get; set; }
+ ///
+ /// Contains the merged inbox this account belongs to.
+ /// Ignored for all SQLite operations.
+ ///
+ [Ignore]
+ public MergedInbox MergedInbox { get; set; }
- ///
- /// Populated only when account has custom server information.
- ///
+ ///
+ /// Populated only when account has custom server information.
+ ///
- [Ignore]
- public CustomServerInformation ServerInformation { get; set; }
+ [Ignore]
+ public CustomServerInformation ServerInformation { get; set; }
- ///
- /// Account preferences.
- ///
- [Ignore]
- public MailAccountPreferences Preferences { get; set; }
+ ///
+ /// Account preferences.
+ ///
+ [Ignore]
+ public MailAccountPreferences Preferences { get; set; }
- ///
- /// Gets whether the account can perform ProfileInformation sync type.
- ///
- public bool IsProfileInfoSyncSupported => ProviderType == MailProviderType.Outlook || ProviderType == MailProviderType.Gmail;
+ ///
+ /// Gets whether the account can perform ProfileInformation sync type.
+ ///
+ public bool IsProfileInfoSyncSupported => ProviderType == MailProviderType.Outlook || ProviderType == MailProviderType.Gmail;
- ///
- /// Gets whether the account can perform AliasInformation sync type.
- ///
- public bool IsAliasSyncSupported => ProviderType == MailProviderType.Gmail;
- }
+ ///
+ /// Gets whether the account can perform AliasInformation sync type.
+ ///
+ public bool IsAliasSyncSupported => ProviderType == MailProviderType.Gmail;
}
diff --git a/Wino.Core.Domain/Entities/Shared/MailAccountPreferences.cs b/Wino.Core.Domain/Entities/Shared/MailAccountPreferences.cs
index 92e97aab..4330db83 100644
--- a/Wino.Core.Domain/Entities/Shared/MailAccountPreferences.cs
+++ b/Wino.Core.Domain/Entities/Shared/MailAccountPreferences.cs
@@ -1,54 +1,53 @@
using System;
using SQLite;
-namespace Wino.Core.Domain.Entities.Shared
+namespace Wino.Core.Domain.Entities.Shared;
+
+public class MailAccountPreferences
{
- public class MailAccountPreferences
- {
- [PrimaryKey]
- public Guid Id { get; set; }
+ [PrimaryKey]
+ public Guid Id { get; set; }
- ///
- /// Id of the account in MailAccount table.
- ///
- public Guid AccountId { get; set; }
+ ///
+ /// Id of the account in MailAccount table.
+ ///
+ public Guid AccountId { get; set; }
- ///
- /// Gets or sets whether sent draft messages should be appended to the sent folder.
- /// Some IMAP servers do this automatically, some don't.
- /// It's disabled by default.
- ///
- public bool ShouldAppendMessagesToSentFolder { get; set; }
+ ///
+ /// Gets or sets whether sent draft messages should be appended to the sent folder.
+ /// Some IMAP servers do this automatically, some don't.
+ /// It's disabled by default.
+ ///
+ public bool ShouldAppendMessagesToSentFolder { get; set; }
- ///
- /// Gets or sets whether the notifications are enabled for the account.
- ///
- public bool IsNotificationsEnabled { get; set; }
+ ///
+ /// Gets or sets whether the notifications are enabled for the account.
+ ///
+ public bool IsNotificationsEnabled { get; set; }
- ///
- /// Gets or sets whether the account has Focused inbox support.
- /// Null if the account provider type doesn't support Focused inbox.
- ///
- public bool? IsFocusedInboxEnabled { get; set; }
+ ///
+ /// Gets or sets whether the account has Focused inbox support.
+ /// Null if the account provider type doesn't support Focused inbox.
+ ///
+ public bool? IsFocusedInboxEnabled { get; set; }
- ///
- /// Gets or sets whether signature should be appended automatically.
- ///
- public bool IsSignatureEnabled { get; set; }
+ ///
+ /// Gets or sets whether signature should be appended automatically.
+ ///
+ public bool IsSignatureEnabled { get; set; }
- ///
- /// Gets or sets whether this account's unread items should be included in taskbar badge.
- ///
- public bool IsTaskbarBadgeEnabled { get; set; } = true;
+ ///
+ /// Gets or sets whether this account's unread items should be included in taskbar badge.
+ ///
+ public bool IsTaskbarBadgeEnabled { get; set; } = true;
- ///
- /// Gets or sets signature for new messages. Null if signature is not needed.
- ///
- public Guid? SignatureIdForNewMessages { get; set; }
+ ///
+ /// Gets or sets signature for new messages. Null if signature is not needed.
+ ///
+ public Guid? SignatureIdForNewMessages { get; set; }
- ///
- /// Gets or sets signature for following messages. Null if signature is not needed.
- ///
- public Guid? SignatureIdForFollowingMessages { get; set; }
- }
+ ///
+ /// Gets or sets signature for following messages. Null if signature is not needed.
+ ///
+ public Guid? SignatureIdForFollowingMessages { get; set; }
}
diff --git a/Wino.Core.Domain/Enums/AccountAttentionReason.cs b/Wino.Core.Domain/Enums/AccountAttentionReason.cs
index b192e74f..61e157b0 100644
--- a/Wino.Core.Domain/Enums/AccountAttentionReason.cs
+++ b/Wino.Core.Domain/Enums/AccountAttentionReason.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum AccountAttentionReason
{
- public enum AccountAttentionReason
- {
- None,
- InvalidCredentials,
- MissingSystemFolderConfiguration
- }
+ None,
+ InvalidCredentials,
+ MissingSystemFolderConfiguration
}
diff --git a/Wino.Core.Domain/Enums/AccountCreationDialogState.cs b/Wino.Core.Domain/Enums/AccountCreationDialogState.cs
index 17393e26..0cc10546 100644
--- a/Wino.Core.Domain/Enums/AccountCreationDialogState.cs
+++ b/Wino.Core.Domain/Enums/AccountCreationDialogState.cs
@@ -1,17 +1,16 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum AccountCreationDialogState
{
- public enum AccountCreationDialogState
- {
- Idle,
- SigningIn,
- PreparingFolders,
- Completed,
- ManuelSetupWaiting,
- TestingConnection,
- AutoDiscoverySetup,
- AutoDiscoveryInProgress,
- FetchingProfileInformation,
- Canceled,
- FetchingEvents
- }
+ Idle,
+ SigningIn,
+ PreparingFolders,
+ Completed,
+ ManuelSetupWaiting,
+ TestingConnection,
+ AutoDiscoverySetup,
+ AutoDiscoveryInProgress,
+ FetchingProfileInformation,
+ Canceled,
+ FetchingEvents
}
diff --git a/Wino.Core.Domain/Enums/AccountSynchronizerState.cs b/Wino.Core.Domain/Enums/AccountSynchronizerState.cs
index 9a9e0810..6f3f22e8 100644
--- a/Wino.Core.Domain/Enums/AccountSynchronizerState.cs
+++ b/Wino.Core.Domain/Enums/AccountSynchronizerState.cs
@@ -1,12 +1,11 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// Indicates the state of synchronizer.
+///
+public enum AccountSynchronizerState
{
- ///
- /// Indicates the state of synchronizer.
- ///
- public enum AccountSynchronizerState
- {
- Idle,
- ExecutingRequests,
- Synchronizing
- }
+ Idle,
+ ExecutingRequests,
+ Synchronizing
}
diff --git a/Wino.Core.Domain/Enums/AppLanguage.cs b/Wino.Core.Domain/Enums/AppLanguage.cs
index 004fad36..9a73afb2 100644
--- a/Wino.Core.Domain/Enums/AppLanguage.cs
+++ b/Wino.Core.Domain/Enums/AppLanguage.cs
@@ -1,21 +1,20 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum AppLanguage
{
- public enum AppLanguage
- {
- None,
- English,
- Deutsch,
- Russian,
- Turkish,
- Polish,
- Czech,
- Chinese,
- Spanish,
- French,
- Indonesian,
- Greek,
- PortugeseBrazil,
- Italian,
- Romanian
- }
+ None,
+ English,
+ Deutsch,
+ Russian,
+ Turkish,
+ Polish,
+ Czech,
+ Chinese,
+ Spanish,
+ French,
+ Indonesian,
+ Greek,
+ PortugeseBrazil,
+ Italian,
+ Romanian
}
diff --git a/Wino.Core.Domain/Enums/AppThemeType.cs b/Wino.Core.Domain/Enums/AppThemeType.cs
index 138f499b..c6e25b79 100644
--- a/Wino.Core.Domain/Enums/AppThemeType.cs
+++ b/Wino.Core.Domain/Enums/AppThemeType.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum AppThemeType
{
- public enum AppThemeType
- {
- System,
- PreDefined,
- Custom,
- }
+ System,
+ PreDefined,
+ Custom,
}
diff --git a/Wino.Core.Domain/Enums/ApplicationElementTheme.cs b/Wino.Core.Domain/Enums/ApplicationElementTheme.cs
index 6c3e0bca..24da4411 100644
--- a/Wino.Core.Domain/Enums/ApplicationElementTheme.cs
+++ b/Wino.Core.Domain/Enums/ApplicationElementTheme.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum ApplicationElementTheme
{
- public enum ApplicationElementTheme
- {
- Default,
- Light,
- Dark
- }
+ Default,
+ Light,
+ Dark
}
diff --git a/Wino.Core.Domain/Enums/AttendeeStatus.cs b/Wino.Core.Domain/Enums/AttendeeStatus.cs
index 57203f30..06bd5a02 100644
--- a/Wino.Core.Domain/Enums/AttendeeStatus.cs
+++ b/Wino.Core.Domain/Enums/AttendeeStatus.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum AttendeeStatus
{
- public enum AttendeeStatus
- {
- NeedsAction,
- Accepted,
- Tentative,
- Declined
- }
+ NeedsAction,
+ Accepted,
+ Tentative,
+ Declined
}
diff --git a/Wino.Core.Domain/Enums/BackgroundSynchronizationReason.cs b/Wino.Core.Domain/Enums/BackgroundSynchronizationReason.cs
index eac0a746..1bd8060c 100644
--- a/Wino.Core.Domain/Enums/BackgroundSynchronizationReason.cs
+++ b/Wino.Core.Domain/Enums/BackgroundSynchronizationReason.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum BackgroundSynchronizationReason
{
- public enum BackgroundSynchronizationReason
- {
- SessionConnected,
- Timer
- }
+ SessionConnected,
+ Timer
}
diff --git a/Wino.Core.Domain/Enums/CalendarDisplayType.cs b/Wino.Core.Domain/Enums/CalendarDisplayType.cs
index d4b4c2b8..5582899b 100644
--- a/Wino.Core.Domain/Enums/CalendarDisplayType.cs
+++ b/Wino.Core.Domain/Enums/CalendarDisplayType.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarDisplayType
{
- public enum CalendarDisplayType
- {
- Day,
- Week,
- WorkWeek,
- Month,
- Year
- }
+ Day,
+ Week,
+ WorkWeek,
+ Month,
+ Year
}
diff --git a/Wino.Core.Domain/Enums/CalendarEventTargetType.cs b/Wino.Core.Domain/Enums/CalendarEventTargetType.cs
index ef42f74f..96d2893e 100644
--- a/Wino.Core.Domain/Enums/CalendarEventTargetType.cs
+++ b/Wino.Core.Domain/Enums/CalendarEventTargetType.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarEventTargetType
{
- public enum CalendarEventTargetType
- {
- Single, // Show details for a single event.
- Series // Show the series event. Parent of all recurring events.
- }
+ Single, // Show details for a single event.
+ Series // Show the series event. Parent of all recurring events.
}
diff --git a/Wino.Core.Domain/Enums/CalendarInitInitiative.cs b/Wino.Core.Domain/Enums/CalendarInitInitiative.cs
index d9a0c880..d5e08a76 100644
--- a/Wino.Core.Domain/Enums/CalendarInitInitiative.cs
+++ b/Wino.Core.Domain/Enums/CalendarInitInitiative.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// Trigger to load more data.
+///
+public enum CalendarInitInitiative
{
- ///
- /// Trigger to load more data.
- ///
- public enum CalendarInitInitiative
- {
- User,
- App
- }
+ User,
+ App
}
diff --git a/Wino.Core.Domain/Enums/CalendarItemRecurrenceFrequency.cs b/Wino.Core.Domain/Enums/CalendarItemRecurrenceFrequency.cs
index 00c6053b..d4288648 100644
--- a/Wino.Core.Domain/Enums/CalendarItemRecurrenceFrequency.cs
+++ b/Wino.Core.Domain/Enums/CalendarItemRecurrenceFrequency.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarItemRecurrenceFrequency
{
- public enum CalendarItemRecurrenceFrequency
- {
- Daily,
- Weekly,
- Monthly,
- Yearly
- }
+ Daily,
+ Weekly,
+ Monthly,
+ Yearly
}
diff --git a/Wino.Core.Domain/Enums/CalendarItemReminderType.cs b/Wino.Core.Domain/Enums/CalendarItemReminderType.cs
index 669a06c6..38bec546 100644
--- a/Wino.Core.Domain/Enums/CalendarItemReminderType.cs
+++ b/Wino.Core.Domain/Enums/CalendarItemReminderType.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarItemReminderType
{
- public enum CalendarItemReminderType
- {
- Popup,
- Email
- }
+ Popup,
+ Email
}
diff --git a/Wino.Core.Domain/Enums/CalendarItemStatus.cs b/Wino.Core.Domain/Enums/CalendarItemStatus.cs
index ac4ce6e8..e8605573 100644
--- a/Wino.Core.Domain/Enums/CalendarItemStatus.cs
+++ b/Wino.Core.Domain/Enums/CalendarItemStatus.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarItemStatus
{
- public enum CalendarItemStatus
- {
- NotResponded,
- Confirmed,
- Tentative,
- Cancelled,
- }
+ NotResponded,
+ Confirmed,
+ Tentative,
+ Cancelled,
}
diff --git a/Wino.Core.Domain/Enums/CalendarItemVisibility.cs b/Wino.Core.Domain/Enums/CalendarItemVisibility.cs
index 5fc3143e..b6804893 100644
--- a/Wino.Core.Domain/Enums/CalendarItemVisibility.cs
+++ b/Wino.Core.Domain/Enums/CalendarItemVisibility.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarItemVisibility
{
- public enum CalendarItemVisibility
- {
- Default,
- Public,
- Private,
- Confidential
- }
+ Default,
+ Public,
+ Private,
+ Confidential
}
diff --git a/Wino.Core.Domain/Enums/CalendarLoadDirection.cs b/Wino.Core.Domain/Enums/CalendarLoadDirection.cs
index b9dbea40..763b25c2 100644
--- a/Wino.Core.Domain/Enums/CalendarLoadDirection.cs
+++ b/Wino.Core.Domain/Enums/CalendarLoadDirection.cs
@@ -1,12 +1,11 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// Which way in time to load more data for calendar.
+///
+public enum CalendarLoadDirection
{
- ///
- /// Which way in time to load more data for calendar.
- ///
- public enum CalendarLoadDirection
- {
- Replace,
- Previous,
- Next
- }
+ Replace,
+ Previous,
+ Next
}
diff --git a/Wino.Core.Domain/Enums/CalendarOrientation.cs b/Wino.Core.Domain/Enums/CalendarOrientation.cs
index 67bd7b0c..d1f7717f 100644
--- a/Wino.Core.Domain/Enums/CalendarOrientation.cs
+++ b/Wino.Core.Domain/Enums/CalendarOrientation.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarOrientation
{
- public enum CalendarOrientation
- {
- Horizontal,
- Vertical
- }
+ Horizontal,
+ Vertical
}
diff --git a/Wino.Core.Domain/Enums/CalendarSynchronizationType.cs b/Wino.Core.Domain/Enums/CalendarSynchronizationType.cs
index 9b19472b..d9f01a19 100644
--- a/Wino.Core.Domain/Enums/CalendarSynchronizationType.cs
+++ b/Wino.Core.Domain/Enums/CalendarSynchronizationType.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CalendarSynchronizationType
{
- public enum CalendarSynchronizationType
- {
- ExecuteRequests, // Execute all requests in the queue.
- CalendarMetadata, // Sync calendar metadata.
- CalendarEvents, // Sync all events for all calendars.
- SingleCalendar, // Sync events for only specified calendars.
- UpdateProfile // Update profile information only.
- }
+ ExecuteRequests, // Execute all requests in the queue.
+ CalendarMetadata, // Sync calendar metadata.
+ CalendarEvents, // Sync all events for all calendars.
+ SingleCalendar, // Sync events for only specified calendars.
+ UpdateProfile // Update profile information only.
}
diff --git a/Wino.Core.Domain/Enums/ChangeRequestType.cs b/Wino.Core.Domain/Enums/ChangeRequestType.cs
index d0af1669..99ede7be 100644
--- a/Wino.Core.Domain/Enums/ChangeRequestType.cs
+++ b/Wino.Core.Domain/Enums/ChangeRequestType.cs
@@ -1,24 +1,23 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum ChangeRequestType
{
- public enum ChangeRequestType
- {
- MailMarkAs,
- MailChangeFlag,
- MailHardDelete,
- MailMove,
- MailAlwaysMoveTo,
- MailChangeFocused,
- MailArchive,
- MailUnarchive,
- FolderMarkAsRead,
- FolderDelete,
- FolderEmpty,
- FolderRename,
- CreateNewDraft,
- CreateReplyDraft,
- CreateForwardDraft,
- DiscardDraft,
- SendDraft,
- FetchSingleItem
- }
+ MailMarkAs,
+ MailChangeFlag,
+ MailHardDelete,
+ MailMove,
+ MailAlwaysMoveTo,
+ MailChangeFocused,
+ MailArchive,
+ MailUnarchive,
+ FolderMarkAsRead,
+ FolderDelete,
+ FolderEmpty,
+ FolderRename,
+ CreateNewDraft,
+ CreateReplyDraft,
+ CreateForwardDraft,
+ DiscardDraft,
+ SendDraft,
+ FetchSingleItem
}
diff --git a/Wino.Core.Domain/Enums/CustomIncomingServerType.cs b/Wino.Core.Domain/Enums/CustomIncomingServerType.cs
index 40312e4a..9890751a 100644
--- a/Wino.Core.Domain/Enums/CustomIncomingServerType.cs
+++ b/Wino.Core.Domain/Enums/CustomIncomingServerType.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum CustomIncomingServerType
{
- public enum CustomIncomingServerType
- {
- POP3,
- IMAP4
- }
+ POP3,
+ IMAP4
}
diff --git a/Wino.Core.Domain/Enums/DayHeaderDisplayType.cs b/Wino.Core.Domain/Enums/DayHeaderDisplayType.cs
index 5a3b96fd..e67067f3 100644
--- a/Wino.Core.Domain/Enums/DayHeaderDisplayType.cs
+++ b/Wino.Core.Domain/Enums/DayHeaderDisplayType.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum DayHeaderDisplayType
{
- public enum DayHeaderDisplayType
- {
- TwelveHour,
- TwentyFourHour,
- }
+ TwelveHour,
+ TwentyFourHour,
}
diff --git a/Wino.Core.Domain/Enums/DraftCreationReason.cs b/Wino.Core.Domain/Enums/DraftCreationReason.cs
index e988c03a..b62e1e2f 100644
--- a/Wino.Core.Domain/Enums/DraftCreationReason.cs
+++ b/Wino.Core.Domain/Enums/DraftCreationReason.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum DraftCreationReason
{
- public enum DraftCreationReason
- {
- Empty,
- Reply,
- ReplyAll,
- Forward
- }
+ Empty,
+ Reply,
+ ReplyAll,
+ Forward
}
diff --git a/Wino.Core.Domain/Enums/FilterOptionType.cs b/Wino.Core.Domain/Enums/FilterOptionType.cs
index 02bf14ff..6f9fce91 100644
--- a/Wino.Core.Domain/Enums/FilterOptionType.cs
+++ b/Wino.Core.Domain/Enums/FilterOptionType.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum FilterOptionType
{
- public enum FilterOptionType
- {
- All,
- Unread,
- Flagged,
- Mentions,
- Files
- }
+ All,
+ Unread,
+ Flagged,
+ Mentions,
+ Files
}
diff --git a/Wino.Core.Domain/Enums/FolderOperation.cs b/Wino.Core.Domain/Enums/FolderOperation.cs
index 2d33144f..b863c0dd 100644
--- a/Wino.Core.Domain/Enums/FolderOperation.cs
+++ b/Wino.Core.Domain/Enums/FolderOperation.cs
@@ -1,23 +1,22 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// Defines all possible folder operations that can be done.
+/// Available values for each folder is returned by IContextMenuProvider
+/// that integrators hold.
+///
+public enum FolderOperation
{
- ///
- /// Defines all possible folder operations that can be done.
- /// Available values for each folder is returned by IContextMenuProvider
- /// that integrators hold.
- ///
- public enum FolderOperation
- {
- None,
- Pin,
- Unpin,
- MarkAllAsRead,
- DontSync,
- Empty,
- Rename,
- Delete,
- Move,
- TurnOffNotifications,
- CreateSubFolder,
- Seperator
- }
+ None,
+ Pin,
+ Unpin,
+ MarkAllAsRead,
+ DontSync,
+ Empty,
+ Rename,
+ Delete,
+ Move,
+ TurnOffNotifications,
+ CreateSubFolder,
+ Seperator
}
diff --git a/Wino.Core.Domain/Enums/ImapAuthenticationMethod.cs b/Wino.Core.Domain/Enums/ImapAuthenticationMethod.cs
index 4390f247..b1922640 100644
--- a/Wino.Core.Domain/Enums/ImapAuthenticationMethod.cs
+++ b/Wino.Core.Domain/Enums/ImapAuthenticationMethod.cs
@@ -1,13 +1,12 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum ImapAuthenticationMethod
{
- public enum ImapAuthenticationMethod
- {
- Auto,
- None,
- NormalPassword,
- EncryptedPassword,
- Ntlm,
- CramMd5,
- DigestMd5
- }
+ Auto,
+ None,
+ NormalPassword,
+ EncryptedPassword,
+ Ntlm,
+ CramMd5,
+ DigestMd5
}
diff --git a/Wino.Core.Domain/Enums/ImapConnectionSecurity.cs b/Wino.Core.Domain/Enums/ImapConnectionSecurity.cs
index 9a3e6e7b..e624bca1 100644
--- a/Wino.Core.Domain/Enums/ImapConnectionSecurity.cs
+++ b/Wino.Core.Domain/Enums/ImapConnectionSecurity.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum ImapConnectionSecurity
{
- public enum ImapConnectionSecurity
- {
- Auto,
- None,
- StartTls,
- SslTls
- }
+ Auto,
+ None,
+ StartTls,
+ SslTls
}
diff --git a/Wino.Core.Domain/Enums/InfoBarAnimationType.cs b/Wino.Core.Domain/Enums/InfoBarAnimationType.cs
index 488b667b..6728a194 100644
--- a/Wino.Core.Domain/Enums/InfoBarAnimationType.cs
+++ b/Wino.Core.Domain/Enums/InfoBarAnimationType.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum InfoBarAnimationType
{
- public enum InfoBarAnimationType
- {
- SlideFromRightToLeft,
- SlideFromBottomToTop
- }
+ SlideFromRightToLeft,
+ SlideFromBottomToTop
}
diff --git a/Wino.Core.Domain/Enums/InfoBarMessageType.cs b/Wino.Core.Domain/Enums/InfoBarMessageType.cs
index 15df6dcf..3bcfed06 100644
--- a/Wino.Core.Domain/Enums/InfoBarMessageType.cs
+++ b/Wino.Core.Domain/Enums/InfoBarMessageType.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum InfoBarMessageType
{
- public enum InfoBarMessageType
- {
- Information,
- Success,
- Warning,
- Error
- }
+ Information,
+ Success,
+ Warning,
+ Error
}
diff --git a/Wino.Core.Domain/Enums/MailAttachmentType.cs b/Wino.Core.Domain/Enums/MailAttachmentType.cs
index b444b4c5..4459a893 100644
--- a/Wino.Core.Domain/Enums/MailAttachmentType.cs
+++ b/Wino.Core.Domain/Enums/MailAttachmentType.cs
@@ -1,16 +1,15 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum MailAttachmentType
{
- public enum MailAttachmentType
- {
- None,
- Executable,
- Image,
- Audio,
- Video,
- PDF,
- HTML,
- RarArchive,
- Archive,
- Other
- }
+ None,
+ Executable,
+ Image,
+ Audio,
+ Video,
+ PDF,
+ HTML,
+ RarArchive,
+ Archive,
+ Other
}
diff --git a/Wino.Core.Domain/Enums/MailImportance.cs b/Wino.Core.Domain/Enums/MailImportance.cs
index 22f2a6ab..0c4ff9fa 100644
--- a/Wino.Core.Domain/Enums/MailImportance.cs
+++ b/Wino.Core.Domain/Enums/MailImportance.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum MailImportance
{
- public enum MailImportance
- {
- Low,
- Normal,
- High
- }
+ Low,
+ Normal,
+ High
}
diff --git a/Wino.Core.Domain/Enums/MailListDisplayMode.cs b/Wino.Core.Domain/Enums/MailListDisplayMode.cs
index d27278e7..c1d04584 100644
--- a/Wino.Core.Domain/Enums/MailListDisplayMode.cs
+++ b/Wino.Core.Domain/Enums/MailListDisplayMode.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum MailListDisplayMode
{
- public enum MailListDisplayMode
- {
- Spacious,
- Medium,
- Compact,
- }
+ Spacious,
+ Medium,
+ Compact,
}
diff --git a/Wino.Core.Domain/Enums/MailMarkAsOption.cs b/Wino.Core.Domain/Enums/MailMarkAsOption.cs
index e08ce803..fe335b5e 100644
--- a/Wino.Core.Domain/Enums/MailMarkAsOption.cs
+++ b/Wino.Core.Domain/Enums/MailMarkAsOption.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum MailMarkAsOption
{
- public enum MailMarkAsOption
- {
- WhenSelected,
- DontMark,
- AfterDelay
- }
+ WhenSelected,
+ DontMark,
+ AfterDelay
}
diff --git a/Wino.Core.Domain/Enums/MailOperation.cs b/Wino.Core.Domain/Enums/MailOperation.cs
index 445e6e4f..973ff62f 100644
--- a/Wino.Core.Domain/Enums/MailOperation.cs
+++ b/Wino.Core.Domain/Enums/MailOperation.cs
@@ -1,58 +1,57 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+// Synchronizer requests.
+public enum MailSynchronizerOperation
{
- // Synchronizer requests.
- public enum MailSynchronizerOperation
- {
- MarkRead,
- Move,
- Delete, // Hard delete.
- CreateDraft,
- Send,
- ChangeFlag,
- AlwaysMoveTo,
- MoveToFocused,
- Archive,
- }
-
- public enum FolderSynchronizerOperation
- {
- RenameFolder,
- EmptyFolder,
- MarkFolderRead,
- }
-
- // UI requests
- public enum MailOperation
- {
- None,
- Archive,
- UnArchive,
- SoftDelete,
- HardDelete,
- Move,
- MoveToJunk,
- MoveToFocused,
- MoveToOther,
- AlwaysMoveToOther,
- AlwaysMoveToFocused,
- SetFlag,
- ClearFlag,
- MarkAsRead,
- MarkAsUnread,
- MarkAsNotJunk,
- Seperator,
- Ignore,
- Reply,
- ReplyAll,
- Zoom,
- SaveAs,
- Find,
- Forward,
- DarkEditor,
- LightEditor,
- Print,
- ViewMessageSource,
- DiscardLocalDraft,
- Navigate // For toast activation
- }
+ MarkRead,
+ Move,
+ Delete, // Hard delete.
+ CreateDraft,
+ Send,
+ ChangeFlag,
+ AlwaysMoveTo,
+ MoveToFocused,
+ Archive,
+}
+
+public enum FolderSynchronizerOperation
+{
+ RenameFolder,
+ EmptyFolder,
+ MarkFolderRead,
+}
+
+// UI requests
+public enum MailOperation
+{
+ None,
+ Archive,
+ UnArchive,
+ SoftDelete,
+ HardDelete,
+ Move,
+ MoveToJunk,
+ MoveToFocused,
+ MoveToOther,
+ AlwaysMoveToOther,
+ AlwaysMoveToFocused,
+ SetFlag,
+ ClearFlag,
+ MarkAsRead,
+ MarkAsUnread,
+ MarkAsNotJunk,
+ Seperator,
+ Ignore,
+ Reply,
+ ReplyAll,
+ Zoom,
+ SaveAs,
+ Find,
+ Forward,
+ DarkEditor,
+ LightEditor,
+ Print,
+ ViewMessageSource,
+ DiscardLocalDraft,
+ Navigate // For toast activation
}
diff --git a/Wino.Core.Domain/Enums/MailProviderType.cs b/Wino.Core.Domain/Enums/MailProviderType.cs
index 1ff81b96..42b6626d 100644
--- a/Wino.Core.Domain/Enums/MailProviderType.cs
+++ b/Wino.Core.Domain/Enums/MailProviderType.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum MailProviderType
{
- public enum MailProviderType
- {
- Outlook,
- Gmail,
- IMAP4 = 4 // 2-3 were removed after release. Don't change for backward compatibility.
- }
+ Outlook,
+ Gmail,
+ IMAP4 = 4 // 2-3 were removed after release. Don't change for backward compatibility.
}
diff --git a/Wino.Core.Domain/Enums/MailSynchronizationType.cs b/Wino.Core.Domain/Enums/MailSynchronizationType.cs
index e7dfe826..650c2a59 100644
--- a/Wino.Core.Domain/Enums/MailSynchronizationType.cs
+++ b/Wino.Core.Domain/Enums/MailSynchronizationType.cs
@@ -1,14 +1,13 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum MailSynchronizationType
{
- public enum MailSynchronizationType
- {
- UpdateProfile, // Only update profile information
- ExecuteRequests, // Run the queued requests, and then synchronize if needed.
- FoldersOnly, // Only synchronize folder metadata.
- InboxOnly, // Only Inbox, Sent, Draft and Deleted folders.
- CustomFolders, // Only sync folders that are specified in the options.
- FullFolders, // Synchronize all folders. This won't update profile or alias information.
- Alias, // Only update alias information
- IMAPIdle // Idle client triggered synchronization.
- }
+ UpdateProfile, // Only update profile information
+ ExecuteRequests, // Run the queued requests, and then synchronize if needed.
+ FoldersOnly, // Only synchronize folder metadata.
+ InboxOnly, // Only Inbox, Sent, Draft and Deleted folders.
+ CustomFolders, // Only sync folders that are specified in the options.
+ FullFolders, // Synchronize all folders. This won't update profile or alias information.
+ Alias, // Only update alias information
+ IMAPIdle // Idle client triggered synchronization.
}
diff --git a/Wino.Core.Domain/Enums/NavigationReferenceFrame.cs b/Wino.Core.Domain/Enums/NavigationReferenceFrame.cs
index 1d116fdb..3495a98e 100644
--- a/Wino.Core.Domain/Enums/NavigationReferenceFrame.cs
+++ b/Wino.Core.Domain/Enums/NavigationReferenceFrame.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum NavigationReferenceFrame
{
- public enum NavigationReferenceFrame
- {
- ShellFrame,
- RenderingFrame
- }
+ ShellFrame,
+ RenderingFrame
}
diff --git a/Wino.Core.Domain/Enums/PickFolderReason.cs b/Wino.Core.Domain/Enums/PickFolderReason.cs
index 99067066..52df0139 100644
--- a/Wino.Core.Domain/Enums/PickFolderReason.cs
+++ b/Wino.Core.Domain/Enums/PickFolderReason.cs
@@ -1,12 +1,11 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// Defines the potential reasons for picking folder in the folder picking dialog.
+///
+public enum PickFolderReason
{
- ///
- /// Defines the potential reasons for picking folder in the folder picking dialog.
- ///
- public enum PickFolderReason
- {
- Move,
- SpecialFolder,
- Any
- }
+ Move,
+ SpecialFolder,
+ Any
}
diff --git a/Wino.Core.Domain/Enums/PrintingResult.cs b/Wino.Core.Domain/Enums/PrintingResult.cs
index 64ab8564..2967b80f 100644
--- a/Wino.Core.Domain/Enums/PrintingResult.cs
+++ b/Wino.Core.Domain/Enums/PrintingResult.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum PrintingResult
{
- public enum PrintingResult
- {
- Abandoned,
- Canceled,
- Failed,
- Submitted
- }
+ Abandoned,
+ Canceled,
+ Failed,
+ Submitted
}
diff --git a/Wino.Core.Domain/Enums/ServerBackgroundMode.cs b/Wino.Core.Domain/Enums/ServerBackgroundMode.cs
index 835a4776..d7f9e5df 100644
--- a/Wino.Core.Domain/Enums/ServerBackgroundMode.cs
+++ b/Wino.Core.Domain/Enums/ServerBackgroundMode.cs
@@ -1,12 +1,11 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// What should happen to server app when the client is terminated.
+///
+public enum ServerBackgroundMode
{
- ///
- /// What should happen to server app when the client is terminated.
- ///
- public enum ServerBackgroundMode
- {
- MinimizedTray, // Still runs, tray icon is visible.
- Invisible, // Still runs, tray icon is invisible.
- Terminate // Server is terminated as Wino terminates.
- }
+ MinimizedTray, // Still runs, tray icon is visible.
+ Invisible, // Still runs, tray icon is invisible.
+ Terminate // Server is terminated as Wino terminates.
}
diff --git a/Wino.Core.Domain/Enums/SortingOptionType.cs b/Wino.Core.Domain/Enums/SortingOptionType.cs
index 4a88d2fd..f259fcf9 100644
--- a/Wino.Core.Domain/Enums/SortingOptionType.cs
+++ b/Wino.Core.Domain/Enums/SortingOptionType.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum SortingOptionType
{
- public enum SortingOptionType
- {
- ReceiveDate,
- Sender
- }
+ ReceiveDate,
+ Sender
}
diff --git a/Wino.Core.Domain/Enums/SpecialFolderType.cs b/Wino.Core.Domain/Enums/SpecialFolderType.cs
index b26ae4c3..e85463f1 100644
--- a/Wino.Core.Domain/Enums/SpecialFolderType.cs
+++ b/Wino.Core.Domain/Enums/SpecialFolderType.cs
@@ -1,24 +1,23 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum SpecialFolderType
{
- public enum SpecialFolderType
- {
- Inbox,
- Starred,
- Important,
- Sent,
- Draft,
- Archive,
- Deleted,
- Junk,
- Chat,
- Category,
- Unread,
- Forums,
- Updates,
- Personal,
- Promotions,
- Social,
- Other,
- More
- }
+ Inbox,
+ Starred,
+ Important,
+ Sent,
+ Draft,
+ Archive,
+ Deleted,
+ Junk,
+ Chat,
+ Category,
+ Unread,
+ Forums,
+ Updates,
+ Personal,
+ Promotions,
+ Social,
+ Other,
+ More
}
diff --git a/Wino.Core.Domain/Enums/SpecialImapProvider.cs b/Wino.Core.Domain/Enums/SpecialImapProvider.cs
index 27254a86..18d182bf 100644
--- a/Wino.Core.Domain/Enums/SpecialImapProvider.cs
+++ b/Wino.Core.Domain/Enums/SpecialImapProvider.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum SpecialImapProvider
{
- public enum SpecialImapProvider
- {
- None,
- iCloud,
- Yahoo
- }
+ None,
+ iCloud,
+ Yahoo
}
diff --git a/Wino.Core.Domain/Enums/StartupBehaviorResult.cs b/Wino.Core.Domain/Enums/StartupBehaviorResult.cs
index 912f0ecc..b33a9e1b 100644
--- a/Wino.Core.Domain/Enums/StartupBehaviorResult.cs
+++ b/Wino.Core.Domain/Enums/StartupBehaviorResult.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum StartupBehaviorResult
{
- public enum StartupBehaviorResult
- {
- Enabled,
- Disabled,
- DisabledByUser,
- DisabledByPolicy,
- Fatal
- }
+ Enabled,
+ Disabled,
+ DisabledByUser,
+ DisabledByPolicy,
+ Fatal
}
diff --git a/Wino.Core.Domain/Enums/StorePurchaseResult.cs b/Wino.Core.Domain/Enums/StorePurchaseResult.cs
index 8364b81a..f86e9a3f 100644
--- a/Wino.Core.Domain/Enums/StorePurchaseResult.cs
+++ b/Wino.Core.Domain/Enums/StorePurchaseResult.cs
@@ -1,19 +1,18 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+// From the SDK.
+public enum StorePurchaseResult
{
- // From the SDK.
- public enum StorePurchaseResult
- {
- //
- // Summary:
- // The purchase request succeeded.
- Succeeded,
- //
- // Summary:
- // The current user has already purchased the specified app or add-on.
- AlreadyPurchased,
- //
- // Summary:
- // The purchase request did not succeed.
- NotPurchased,
- }
+ //
+ // Summary:
+ // The purchase request succeeded.
+ Succeeded,
+ //
+ // Summary:
+ // The current user has already purchased the specified app or add-on.
+ AlreadyPurchased,
+ //
+ // Summary:
+ // The purchase request did not succeed.
+ NotPurchased,
}
diff --git a/Wino.Core.Domain/Enums/SynchronizationCompletedState.cs b/Wino.Core.Domain/Enums/SynchronizationCompletedState.cs
index b4376afe..6a2edb6c 100644
--- a/Wino.Core.Domain/Enums/SynchronizationCompletedState.cs
+++ b/Wino.Core.Domain/Enums/SynchronizationCompletedState.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum SynchronizationCompletedState
{
- public enum SynchronizationCompletedState
- {
- Success, // All succeeded.
- Canceled, // Canceled by user or HTTP call.
- Failed // Exception.
- }
+ Success, // All succeeded.
+ Canceled, // Canceled by user or HTTP call.
+ Failed // Exception.
}
diff --git a/Wino.Core.Domain/Enums/SynchronizationSource.cs b/Wino.Core.Domain/Enums/SynchronizationSource.cs
index f64b00e5..d7b3e2d3 100644
--- a/Wino.Core.Domain/Enums/SynchronizationSource.cs
+++ b/Wino.Core.Domain/Enums/SynchronizationSource.cs
@@ -1,12 +1,11 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+///
+/// Enumeration for the source of synchronization.
+/// Right now it can either be from the client or the server.
+///
+public enum SynchronizationSource
{
- ///
- /// Enumeration for the source of synchronization.
- /// Right now it can either be from the client or the server.
- ///
- public enum SynchronizationSource
- {
- Client,
- Server
- }
+ Client,
+ Server
}
diff --git a/Wino.Core.Domain/Enums/WinoAppType.cs b/Wino.Core.Domain/Enums/WinoAppType.cs
index da453cd5..4a35b9c8 100644
--- a/Wino.Core.Domain/Enums/WinoAppType.cs
+++ b/Wino.Core.Domain/Enums/WinoAppType.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum WinoAppType
{
- public enum WinoAppType
- {
- Unknown,
- Mail,
- Calendar
- }
+ Unknown,
+ Mail,
+ Calendar
}
diff --git a/Wino.Core.Domain/Enums/WinoCustomMessageDialogIcon.cs b/Wino.Core.Domain/Enums/WinoCustomMessageDialogIcon.cs
index c85bb5af..11dbeab7 100644
--- a/Wino.Core.Domain/Enums/WinoCustomMessageDialogIcon.cs
+++ b/Wino.Core.Domain/Enums/WinoCustomMessageDialogIcon.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum WinoCustomMessageDialogIcon
{
- public enum WinoCustomMessageDialogIcon
- {
- Information,
- Warning,
- Error,
- Question
- }
+ Information,
+ Warning,
+ Error,
+ Question
}
diff --git a/Wino.Core.Domain/Enums/WinoPage.cs b/Wino.Core.Domain/Enums/WinoPage.cs
index 2ad07bcf..2ef77757 100644
--- a/Wino.Core.Domain/Enums/WinoPage.cs
+++ b/Wino.Core.Domain/Enums/WinoPage.cs
@@ -1,34 +1,33 @@
-namespace Wino.Core.Domain.Enums
-{
- ///
- /// All registered views.
- ///
- public enum WinoPage
- {
- None,
- IdlePage,
- ComposePage,
- SettingsPage,
- MailRenderingPage,
- WelcomePage,
- AccountDetailsPage,
- MergedAccountDetailsPage,
- ManageAccountsPage,
- AccountManagementPage,
- SignatureManagementPage,
- AboutPage,
- PersonalizationPage,
- MessageListPage,
- MailListPage,
- ReadComposePanePage,
- LanguageTimePage,
- AppPreferencesPage,
- SettingOptionsPage,
- AliasManagementPage,
+namespace Wino.Core.Domain.Enums;
- // Calendar
- CalendarPage,
- CalendarSettingsPage,
- EventDetailsPage
- }
+///
+/// All registered views.
+///
+public enum WinoPage
+{
+ None,
+ IdlePage,
+ ComposePage,
+ SettingsPage,
+ MailRenderingPage,
+ WelcomePage,
+ AccountDetailsPage,
+ MergedAccountDetailsPage,
+ ManageAccountsPage,
+ AccountManagementPage,
+ SignatureManagementPage,
+ AboutPage,
+ PersonalizationPage,
+ MessageListPage,
+ MailListPage,
+ ReadComposePanePage,
+ LanguageTimePage,
+ AppPreferencesPage,
+ SettingOptionsPage,
+ AliasManagementPage,
+
+ // Calendar
+ CalendarPage,
+ CalendarSettingsPage,
+ EventDetailsPage
}
diff --git a/Wino.Core.Domain/Enums/WinoServerConnectionStatus.cs b/Wino.Core.Domain/Enums/WinoServerConnectionStatus.cs
index e997ce4b..9897b5bd 100644
--- a/Wino.Core.Domain/Enums/WinoServerConnectionStatus.cs
+++ b/Wino.Core.Domain/Enums/WinoServerConnectionStatus.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Enums
+namespace Wino.Core.Domain.Enums;
+
+public enum WinoServerConnectionStatus
{
- public enum WinoServerConnectionStatus
- {
- None,
- Connecting,
- Connected,
- Disconnected,
- Failed
- }
+ None,
+ Connecting,
+ Connected,
+ Disconnected,
+ Failed
}
diff --git a/Wino.Core.Domain/Exceptions/AccountSetupCanceledException.cs b/Wino.Core.Domain/Exceptions/AccountSetupCanceledException.cs
index 03819076..05a8c616 100644
--- a/Wino.Core.Domain/Exceptions/AccountSetupCanceledException.cs
+++ b/Wino.Core.Domain/Exceptions/AccountSetupCanceledException.cs
@@ -1,7 +1,6 @@
-namespace Wino.Core.Domain.Exceptions
-{
- public class AccountSetupCanceledException : System.Exception
- {
+namespace Wino.Core.Domain.Exceptions;
+
+public class AccountSetupCanceledException : System.Exception
+{
- }
}
diff --git a/Wino.Core.Domain/Exceptions/AuthenticationAttentionException.cs b/Wino.Core.Domain/Exceptions/AuthenticationAttentionException.cs
index 3d775d17..9d19e8dd 100644
--- a/Wino.Core.Domain/Exceptions/AuthenticationAttentionException.cs
+++ b/Wino.Core.Domain/Exceptions/AuthenticationAttentionException.cs
@@ -1,19 +1,18 @@
using System;
using Wino.Core.Domain.Entities.Shared;
-namespace Wino.Core.Domain.Exceptions
-{
- ///
- /// Thrown when IAuthenticator requires user interaction to fix authentication issues.
- /// It can be expired and can't restorable token, or some stuff that requires re-authentication.
- ///
- public class AuthenticationAttentionException : Exception
- {
- public AuthenticationAttentionException(MailAccount account)
- {
- Account = account;
- }
+namespace Wino.Core.Domain.Exceptions;
- public MailAccount Account { get; }
+///
+/// Thrown when IAuthenticator requires user interaction to fix authentication issues.
+/// It can be expired and can't restorable token, or some stuff that requires re-authentication.
+///
+public class AuthenticationAttentionException : Exception
+{
+ public AuthenticationAttentionException(MailAccount account)
+ {
+ Account = account;
}
+
+ public MailAccount Account { get; }
}
diff --git a/Wino.Core.Domain/Exceptions/AuthenticationException.cs b/Wino.Core.Domain/Exceptions/AuthenticationException.cs
index 87e622df..ae7877ce 100644
--- a/Wino.Core.Domain/Exceptions/AuthenticationException.cs
+++ b/Wino.Core.Domain/Exceptions/AuthenticationException.cs
@@ -1,18 +1,17 @@
using System;
-namespace Wino.Core.Domain.Exceptions
-{
- ///
- /// All exceptions related to authentication.
- ///
- public class AuthenticationException : Exception
- {
- public AuthenticationException(string message) : base(message)
- {
- }
+namespace Wino.Core.Domain.Exceptions;
- public AuthenticationException(string message, Exception innerException) : base(message, innerException)
- {
- }
+///
+/// All exceptions related to authentication.
+///
+public class AuthenticationException : Exception
+{
+ public AuthenticationException(string message) : base(message)
+ {
+ }
+
+ public AuthenticationException(string message, Exception innerException) : base(message, innerException)
+ {
}
}
diff --git a/Wino.Core.Domain/Exceptions/BackgroundTaskRegistrationFailedException.cs b/Wino.Core.Domain/Exceptions/BackgroundTaskRegistrationFailedException.cs
index 50d3d40d..1a8ac966 100644
--- a/Wino.Core.Domain/Exceptions/BackgroundTaskRegistrationFailedException.cs
+++ b/Wino.Core.Domain/Exceptions/BackgroundTaskRegistrationFailedException.cs
@@ -1,9 +1,8 @@
using System;
-namespace Wino.Core.Domain.Exceptions
-{
- ///
- /// An exception thrown when the background task registration is failed.
- ///
- public class BackgroundTaskRegistrationFailedException : Exception { }
-}
+namespace Wino.Core.Domain.Exceptions;
+
+///
+/// An exception thrown when the background task registration is failed.
+///
+public class BackgroundTaskRegistrationFailedException : Exception { }
diff --git a/Wino.Core.Domain/Exceptions/ComposerMimeNotFoundException.cs b/Wino.Core.Domain/Exceptions/ComposerMimeNotFoundException.cs
index 2a82d580..8f06bdce 100644
--- a/Wino.Core.Domain/Exceptions/ComposerMimeNotFoundException.cs
+++ b/Wino.Core.Domain/Exceptions/ComposerMimeNotFoundException.cs
@@ -1,11 +1,10 @@
using System;
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+///
+/// Thrown when composer cant find the mime to load.
+///
+public class ComposerMimeNotFoundException : Exception
{
- ///
- /// Thrown when composer cant find the mime to load.
- ///
- public class ComposerMimeNotFoundException : Exception
- {
- }
}
diff --git a/Wino.Core.Domain/Exceptions/CustomThemeCreationFailedException.cs b/Wino.Core.Domain/Exceptions/CustomThemeCreationFailedException.cs
index 8ffd3992..f1f64dd9 100644
--- a/Wino.Core.Domain/Exceptions/CustomThemeCreationFailedException.cs
+++ b/Wino.Core.Domain/Exceptions/CustomThemeCreationFailedException.cs
@@ -1,11 +1,10 @@
using System;
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+public class CustomThemeCreationFailedException : Exception
{
- public class CustomThemeCreationFailedException : Exception
+ public CustomThemeCreationFailedException(string message) : base(message)
{
- public CustomThemeCreationFailedException(string message) : base(message)
- {
- }
}
}
diff --git a/Wino.Core.Domain/Exceptions/GoogleAuthenticationException.cs b/Wino.Core.Domain/Exceptions/GoogleAuthenticationException.cs
index 71d244c1..651e0530 100644
--- a/Wino.Core.Domain/Exceptions/GoogleAuthenticationException.cs
+++ b/Wino.Core.Domain/Exceptions/GoogleAuthenticationException.cs
@@ -1,7 +1,6 @@
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+public class GoogleAuthenticationException : System.Exception
{
- public class GoogleAuthenticationException : System.Exception
- {
- public GoogleAuthenticationException(string message) : base(message) { }
- }
+ public GoogleAuthenticationException(string message) : base(message) { }
}
diff --git a/Wino.Core.Domain/Exceptions/ImapClientPoolException.cs b/Wino.Core.Domain/Exceptions/ImapClientPoolException.cs
index 41226041..9a185743 100644
--- a/Wino.Core.Domain/Exceptions/ImapClientPoolException.cs
+++ b/Wino.Core.Domain/Exceptions/ImapClientPoolException.cs
@@ -1,14 +1,13 @@
using System;
-namespace Wino.Core.Domain.Exceptions
-{
- public class ImapClientPoolException : Exception
- {
- public ImapClientPoolException(Exception innerException, string protocolLog) : base(Translator.Exception_ImapClientPoolFailed, innerException)
- {
- ProtocolLog = protocolLog;
- }
+namespace Wino.Core.Domain.Exceptions;
- public string ProtocolLog { get; }
+public class ImapClientPoolException : Exception
+{
+ public ImapClientPoolException(Exception innerException, string protocolLog) : base(Translator.Exception_ImapClientPoolFailed, innerException)
+ {
+ ProtocolLog = protocolLog;
}
+
+ public string ProtocolLog { get; }
}
diff --git a/Wino.Core.Domain/Exceptions/ImapConnectionFailedPackage.cs b/Wino.Core.Domain/Exceptions/ImapConnectionFailedPackage.cs
index 10b956f8..e431d969 100644
--- a/Wino.Core.Domain/Exceptions/ImapConnectionFailedPackage.cs
+++ b/Wino.Core.Domain/Exceptions/ImapConnectionFailedPackage.cs
@@ -1,18 +1,17 @@
using Wino.Core.Domain.Models.AutoDiscovery;
-namespace Wino.Core.Domain.Exceptions
-{
- public class ImapConnectionFailedPackage
- {
- public ImapConnectionFailedPackage(string errorMessage, string protocolLog, AutoDiscoverySettings settings)
- {
- ErrorMessage = errorMessage;
- ProtocolLog = protocolLog;
- Settings = settings;
- }
+namespace Wino.Core.Domain.Exceptions;
- public AutoDiscoverySettings Settings { get; }
- public string ErrorMessage { get; set; }
- public string ProtocolLog { get; }
+public class ImapConnectionFailedPackage
+{
+ public ImapConnectionFailedPackage(string errorMessage, string protocolLog, AutoDiscoverySettings settings)
+ {
+ ErrorMessage = errorMessage;
+ ProtocolLog = protocolLog;
+ Settings = settings;
}
+
+ public AutoDiscoverySettings Settings { get; }
+ public string ErrorMessage { get; set; }
+ public string ProtocolLog { get; }
}
diff --git a/Wino.Core.Domain/Exceptions/ImapSynchronizerStrategyException.cs b/Wino.Core.Domain/Exceptions/ImapSynchronizerStrategyException.cs
index e59927ab..46a87bdf 100644
--- a/Wino.Core.Domain/Exceptions/ImapSynchronizerStrategyException.cs
+++ b/Wino.Core.Domain/Exceptions/ImapSynchronizerStrategyException.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Exceptions
-{
- public class ImapSynchronizerStrategyException : System.Exception
- {
- public ImapSynchronizerStrategyException(string message) : base(message)
- {
+namespace Wino.Core.Domain.Exceptions;
+
+public class ImapSynchronizerStrategyException : System.Exception
+{
+ public ImapSynchronizerStrategyException(string message) : base(message)
+ {
- }
}
}
diff --git a/Wino.Core.Domain/Exceptions/ImapTestSSLCertificateException.cs b/Wino.Core.Domain/Exceptions/ImapTestSSLCertificateException.cs
index 7b15c3cb..6fa96bdf 100644
--- a/Wino.Core.Domain/Exceptions/ImapTestSSLCertificateException.cs
+++ b/Wino.Core.Domain/Exceptions/ImapTestSSLCertificateException.cs
@@ -1,17 +1,16 @@
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+public class ImapTestSSLCertificateException : System.Exception
{
- public class ImapTestSSLCertificateException : System.Exception
+ public ImapTestSSLCertificateException(string issuer, string expirationDateString, string validFromDateString)
{
- public ImapTestSSLCertificateException(string issuer, string expirationDateString, string validFromDateString)
- {
- Issuer = issuer;
- ExpirationDateString = expirationDateString;
- ValidFromDateString = validFromDateString;
- }
-
- public string Issuer { get; set; }
- public string ExpirationDateString { get; set; }
- public string ValidFromDateString { get; set; }
-
+ Issuer = issuer;
+ ExpirationDateString = expirationDateString;
+ ValidFromDateString = validFromDateString;
}
+
+ public string Issuer { get; set; }
+ public string ExpirationDateString { get; set; }
+ public string ValidFromDateString { get; set; }
+
}
diff --git a/Wino.Core.Domain/Exceptions/InvalidMoveTargetException.cs b/Wino.Core.Domain/Exceptions/InvalidMoveTargetException.cs
index 05f3e7b4..830a8205 100644
--- a/Wino.Core.Domain/Exceptions/InvalidMoveTargetException.cs
+++ b/Wino.Core.Domain/Exceptions/InvalidMoveTargetException.cs
@@ -1,6 +1,5 @@
using System;
-namespace Wino.Core.Domain.Exceptions
-{
- public class InvalidMoveTargetException : Exception { }
-}
+namespace Wino.Core.Domain.Exceptions;
+
+public class InvalidMoveTargetException : Exception { }
diff --git a/Wino.Core.Domain/Exceptions/MissingAliasException.cs b/Wino.Core.Domain/Exceptions/MissingAliasException.cs
index f81cb8c6..adc19e06 100644
--- a/Wino.Core.Domain/Exceptions/MissingAliasException.cs
+++ b/Wino.Core.Domain/Exceptions/MissingAliasException.cs
@@ -1,7 +1,6 @@
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+public class MissingAliasException : System.Exception
{
- public class MissingAliasException : System.Exception
- {
- public MissingAliasException() : base(Translator.Exception_MissingAlias) { }
- }
+ public MissingAliasException() : base(Translator.Exception_MissingAlias) { }
}
diff --git a/Wino.Core.Domain/Exceptions/SynchronizerEntityNotFoundException.cs b/Wino.Core.Domain/Exceptions/SynchronizerEntityNotFoundException.cs
index 4d35aad6..eb337480 100644
--- a/Wino.Core.Domain/Exceptions/SynchronizerEntityNotFoundException.cs
+++ b/Wino.Core.Domain/Exceptions/SynchronizerEntityNotFoundException.cs
@@ -1,11 +1,10 @@
using System;
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+public class SynchronizerEntityNotFoundException : Exception
{
- public class SynchronizerEntityNotFoundException : Exception
+ public SynchronizerEntityNotFoundException(string message) : base(message)
{
- public SynchronizerEntityNotFoundException(string message) : base(message)
- {
- }
}
}
diff --git a/Wino.Core.Domain/Exceptions/SynchronizerException.cs b/Wino.Core.Domain/Exceptions/SynchronizerException.cs
index cd2960fb..d5b66938 100644
--- a/Wino.Core.Domain/Exceptions/SynchronizerException.cs
+++ b/Wino.Core.Domain/Exceptions/SynchronizerException.cs
@@ -1,15 +1,14 @@
using System;
-namespace Wino.Core.Domain.Exceptions
-{
- public class SynchronizerException : Exception
- {
- public SynchronizerException(string message) : base(message)
- {
- }
+namespace Wino.Core.Domain.Exceptions;
- public SynchronizerException(string message, Exception innerException) : base(message, innerException)
- {
- }
+public class SynchronizerException : Exception
+{
+ public SynchronizerException(string message) : base(message)
+ {
+ }
+
+ public SynchronizerException(string message, Exception innerException) : base(message, innerException)
+ {
}
}
diff --git a/Wino.Core.Domain/Exceptions/SystemFolderConfigurationMissingException.cs b/Wino.Core.Domain/Exceptions/SystemFolderConfigurationMissingException.cs
index 918aa253..a49405c4 100644
--- a/Wino.Core.Domain/Exceptions/SystemFolderConfigurationMissingException.cs
+++ b/Wino.Core.Domain/Exceptions/SystemFolderConfigurationMissingException.cs
@@ -1,7 +1,6 @@
-namespace Wino.Core.Domain.Exceptions
-{
- ///
- /// When IMAP account's system folder configuration setup is not done yet.
- ///
- public class SystemFolderConfigurationMissingException : System.Exception { }
-}
+namespace Wino.Core.Domain.Exceptions;
+
+///
+/// When IMAP account's system folder configuration setup is not done yet.
+///
+public class SystemFolderConfigurationMissingException : System.Exception { }
diff --git a/Wino.Core.Domain/Exceptions/UnavailableSpecialFolderException.cs b/Wino.Core.Domain/Exceptions/UnavailableSpecialFolderException.cs
index 9153cbaa..81b17b44 100644
--- a/Wino.Core.Domain/Exceptions/UnavailableSpecialFolderException.cs
+++ b/Wino.Core.Domain/Exceptions/UnavailableSpecialFolderException.cs
@@ -1,20 +1,19 @@
using System;
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Exceptions
-{
- ///
- /// Emitted when special folder is needed for an operation but it couldn't be found.
- ///
- public class UnavailableSpecialFolderException : Exception
- {
- public UnavailableSpecialFolderException(SpecialFolderType specialFolderType, Guid accountId)
- {
- SpecialFolderType = specialFolderType;
- AccountId = accountId;
- }
+namespace Wino.Core.Domain.Exceptions;
- public SpecialFolderType SpecialFolderType { get; }
- public Guid AccountId { get; set; }
+///
+/// Emitted when special folder is needed for an operation but it couldn't be found.
+///
+public class UnavailableSpecialFolderException : Exception
+{
+ public UnavailableSpecialFolderException(SpecialFolderType specialFolderType, Guid accountId)
+ {
+ SpecialFolderType = specialFolderType;
+ AccountId = accountId;
}
+
+ public SpecialFolderType SpecialFolderType { get; }
+ public Guid AccountId { get; set; }
}
diff --git a/Wino.Core.Domain/Exceptions/WinoServerException.cs b/Wino.Core.Domain/Exceptions/WinoServerException.cs
index 8cbf87d4..afa7f132 100644
--- a/Wino.Core.Domain/Exceptions/WinoServerException.cs
+++ b/Wino.Core.Domain/Exceptions/WinoServerException.cs
@@ -1,12 +1,11 @@
using System;
-namespace Wino.Core.Domain.Exceptions
+namespace Wino.Core.Domain.Exceptions;
+
+///
+/// All server crash types. Wino Server ideally should not throw anything else than this Exception type.
+///
+public class WinoServerException : Exception
{
- ///
- /// All server crash types. Wino Server ideally should not throw anything else than this Exception type.
- ///
- public class WinoServerException : Exception
- {
- public WinoServerException(string message) : base(message) { }
- }
+ public WinoServerException(string message) : base(message) { }
}
diff --git a/Wino.Core.Domain/Extensions/DateTimeExtensions.cs b/Wino.Core.Domain/Extensions/DateTimeExtensions.cs
index 69c1b571..f026c80f 100644
--- a/Wino.Core.Domain/Extensions/DateTimeExtensions.cs
+++ b/Wino.Core.Domain/Extensions/DateTimeExtensions.cs
@@ -1,33 +1,32 @@
using System;
using Wino.Core.Domain.Models.Calendar;
-namespace Wino.Core.Domain.Extensions
+namespace Wino.Core.Domain.Extensions;
+
+public static class DateTimeExtensions
{
- public static class DateTimeExtensions
+ ///
+ /// Returns a date range for the month of the given date.
+ ///
+ /// Date to get range for.
+ public static DateRange GetMonthDateRangeStartingWeekday(this DateTime date, DayOfWeek WeekStartDay)
{
- ///
- /// Returns a date range for the month of the given date.
- ///
- /// Date to get range for.
- public static DateRange GetMonthDateRangeStartingWeekday(this DateTime date, DayOfWeek WeekStartDay)
- {
- DateTime firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
+ DateTime firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
- int daysToSubtract = (7 + (firstDayOfMonth.DayOfWeek - WeekStartDay)) % 7;
- DateTime rangeStart = firstDayOfMonth.AddDays(-daysToSubtract);
+ int daysToSubtract = (7 + (firstDayOfMonth.DayOfWeek - WeekStartDay)) % 7;
+ DateTime rangeStart = firstDayOfMonth.AddDays(-daysToSubtract);
- DateTime rangeEnd = rangeStart.AddDays(34);
+ DateTime rangeEnd = rangeStart.AddDays(34);
- return new DateRange(rangeStart, rangeEnd);
- }
+ return new DateRange(rangeStart, rangeEnd);
+ }
- public static DateTime GetWeekStartDateForDate(this DateTime date, DayOfWeek firstDayOfWeek)
- {
- // Detect the first day of the week that contains the selected date.
- int diff = (7 + (date.DayOfWeek - firstDayOfWeek)) % 7;
+ public static DateTime GetWeekStartDateForDate(this DateTime date, DayOfWeek firstDayOfWeek)
+ {
+ // Detect the first day of the week that contains the selected date.
+ int diff = (7 + (date.DayOfWeek - firstDayOfWeek)) % 7;
- // Start loading from this date instead of visible date.
- return date.AddDays(-diff).Date;
- }
+ // Start loading from this date instead of visible date.
+ return date.AddDays(-diff).Date;
}
}
diff --git a/Wino.Core.Domain/Extensions/ExceptionExtensions.cs b/Wino.Core.Domain/Extensions/ExceptionExtensions.cs
index b42a0206..d7d62238 100644
--- a/Wino.Core.Domain/Extensions/ExceptionExtensions.cs
+++ b/Wino.Core.Domain/Extensions/ExceptionExtensions.cs
@@ -1,24 +1,23 @@
using System;
using System.Collections.Generic;
-namespace Wino.Core.Domain.Extensions
-{
- public static class ExceptionExtensions
- {
- public static IEnumerable GetInnerExceptions(this Exception ex)
- {
- if (ex == null)
- {
- throw new ArgumentNullException("ex");
- }
+namespace Wino.Core.Domain.Extensions;
- var innerException = ex;
- do
- {
- yield return innerException;
- innerException = innerException.InnerException;
- }
- while (innerException != null);
+public static class ExceptionExtensions
+{
+ public static IEnumerable GetInnerExceptions(this Exception ex)
+ {
+ if (ex == null)
+ {
+ throw new ArgumentNullException("ex");
}
+
+ var innerException = ex;
+ do
+ {
+ yield return innerException;
+ innerException = innerException.InnerException;
+ }
+ while (innerException != null);
}
}
diff --git a/Wino.Core.Domain/Extensions/MimeExtensions.cs b/Wino.Core.Domain/Extensions/MimeExtensions.cs
index 1555e932..98a9b0c9 100644
--- a/Wino.Core.Domain/Extensions/MimeExtensions.cs
+++ b/Wino.Core.Domain/Extensions/MimeExtensions.cs
@@ -1,20 +1,19 @@
using System;
using System.IO;
-namespace Wino.Core.Domain.Extensions
+namespace Wino.Core.Domain.Extensions;
+
+public static class MimeExtensions
{
- public static class MimeExtensions
+ public static string GetBase64MimeMessage(this MimeKit.MimeMessage message)
{
- public static string GetBase64MimeMessage(this MimeKit.MimeMessage message)
- {
- using MemoryStream memoryStream = new();
+ using MemoryStream memoryStream = new();
- message.WriteTo(memoryStream);
+ message.WriteTo(memoryStream);
- return Convert.ToBase64String(memoryStream.ToArray());
- }
-
- public static MimeKit.MimeMessage GetMimeMessageFromBase64(this string base64)
- => MimeKit.MimeMessage.Load(new System.IO.MemoryStream(Convert.FromBase64String(base64)));
+ return Convert.ToBase64String(memoryStream.ToArray());
}
+
+ public static MimeKit.MimeMessage GetMimeMessageFromBase64(this string base64)
+ => MimeKit.MimeMessage.Load(new System.IO.MemoryStream(Convert.FromBase64String(base64)));
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountCalendar.cs b/Wino.Core.Domain/Interfaces/IAccountCalendar.cs
index 32c908cb..85a340c3 100644
--- a/Wino.Core.Domain/Interfaces/IAccountCalendar.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountCalendar.cs
@@ -1,16 +1,15 @@
using System;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountCalendar
{
- public interface IAccountCalendar
- {
- string Name { get; set; }
- string TextColorHex { get; set; }
- string BackgroundColorHex { get; set; }
- bool IsPrimary { get; set; }
- Guid AccountId { get; set; }
- string RemoteCalendarId { get; set; }
- bool IsExtended { get; set; }
- Guid Id { get; set; }
- }
+ string Name { get; set; }
+ string TextColorHex { get; set; }
+ string BackgroundColorHex { get; set; }
+ bool IsPrimary { get; set; }
+ Guid AccountId { get; set; }
+ string RemoteCalendarId { get; set; }
+ bool IsExtended { get; set; }
+ Guid Id { get; set; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountCreationDialog.cs b/Wino.Core.Domain/Interfaces/IAccountCreationDialog.cs
index 8454a4ed..2cf94608 100644
--- a/Wino.Core.Domain/Interfaces/IAccountCreationDialog.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountCreationDialog.cs
@@ -2,12 +2,11 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountCreationDialog
{
- public interface IAccountCreationDialog
- {
- Task ShowDialogAsync(CancellationTokenSource cancellationTokenSource);
- void Complete(bool cancel);
- AccountCreationDialogState State { get; set; }
- }
+ Task ShowDialogAsync(CancellationTokenSource cancellationTokenSource);
+ void Complete(bool cancel);
+ AccountCreationDialogState State { get; set; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountMenuItem.cs b/Wino.Core.Domain/Interfaces/IAccountMenuItem.cs
index 3faca7f0..b3a917bd 100644
--- a/Wino.Core.Domain/Interfaces/IAccountMenuItem.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountMenuItem.cs
@@ -2,21 +2,20 @@
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Entities.Shared;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountMenuItem : IMenuItem
{
- public interface IAccountMenuItem : IMenuItem
- {
- bool IsEnabled { get; set; }
- double SynchronizationProgress { get; set; }
- int UnreadItemCount { get; set; }
- IEnumerable HoldingAccounts { get; }
- void UpdateAccount(MailAccount account);
- }
-
- public interface IMergedAccountMenuItem : IAccountMenuItem
- {
- int MergedAccountCount { get; }
-
- MergedInbox Parameter { get; }
- }
+ bool IsEnabled { get; set; }
+ double SynchronizationProgress { get; set; }
+ int UnreadItemCount { get; set; }
+ IEnumerable HoldingAccounts { get; }
+ void UpdateAccount(MailAccount account);
+}
+
+public interface IMergedAccountMenuItem : IAccountMenuItem
+{
+ int MergedAccountCount { get; }
+
+ MergedInbox Parameter { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountPickerDialog.cs b/Wino.Core.Domain/Interfaces/IAccountPickerDialog.cs
index a43bbc26..52a0c33a 100644
--- a/Wino.Core.Domain/Interfaces/IAccountPickerDialog.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountPickerDialog.cs
@@ -1,6 +1,5 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountPickerDialog
{
- public interface IAccountPickerDialog
- {
- }
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountProviderDetailViewModel.cs b/Wino.Core.Domain/Interfaces/IAccountProviderDetailViewModel.cs
index d4a9b279..2272974b 100644
--- a/Wino.Core.Domain/Interfaces/IAccountProviderDetailViewModel.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountProviderDetailViewModel.cs
@@ -1,38 +1,37 @@
using System;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountProviderDetailViewModel
{
- public interface IAccountProviderDetailViewModel
- {
- ///
- /// Entity id that will help to identify the startup entity on launch.
- ///
- Guid StartupEntityId { get; }
+ ///
+ /// Entity id that will help to identify the startup entity on launch.
+ ///
+ Guid StartupEntityId { get; }
- ///
- /// Name representation of the view model that will be used to identify the startup entity on launch.
- ///
- string StartupEntityTitle { get; }
+ ///
+ /// Name representation of the view model that will be used to identify the startup entity on launch.
+ ///
+ string StartupEntityTitle { get; }
- ///
- /// E-mail addresses that this account holds.
- ///
+ ///
+ /// E-mail addresses that this account holds.
+ ///
- string StartupEntityAddresses { get; }
+ string StartupEntityAddresses { get; }
- ///
- /// Represents the account order in the accounts list.
- ///
- int Order { get; }
+ ///
+ /// Represents the account order in the accounts list.
+ ///
+ int Order { get; }
- ///
- /// Provider details of the account.
- ///
- IProviderDetail ProviderDetail { get; set; }
+ ///
+ /// Provider details of the account.
+ ///
+ IProviderDetail ProviderDetail { get; set; }
- ///
- /// How many accounts this provider has.
- ///
- int HoldingAccountCount { get; }
- }
+ ///
+ /// How many accounts this provider has.
+ ///
+ int HoldingAccountCount { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountProviderDetails.cs b/Wino.Core.Domain/Interfaces/IAccountProviderDetails.cs
index c5b7c5f5..66eb5b10 100644
--- a/Wino.Core.Domain/Interfaces/IAccountProviderDetails.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountProviderDetails.cs
@@ -1,11 +1,10 @@
using Wino.Core.Domain.Entities.Shared;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountProviderDetails
{
- public interface IAccountProviderDetails
- {
- MailAccount Account { get; set; }
- bool AutoExtend { get; set; }
- IProviderDetail ProviderDetail { get; set; }
- }
+ MailAccount Account { get; set; }
+ bool AutoExtend { get; set; }
+ IProviderDetail ProviderDetail { get; set; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAccountService.cs b/Wino.Core.Domain/Interfaces/IAccountService.cs
index 8a226f25..338e4270 100644
--- a/Wino.Core.Domain/Interfaces/IAccountService.cs
+++ b/Wino.Core.Domain/Interfaces/IAccountService.cs
@@ -5,156 +5,155 @@ using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Models.Accounts;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAccountService
{
- public interface IAccountService
- {
- ///
- /// Current IAuthenticator that should receive external authentication process to continue with.
- /// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator
- /// to continue process for token exchange.
- ///
- IAuthenticator ExternalAuthenticationAuthenticator { get; set; }
+ ///
+ /// Current IAuthenticator that should receive external authentication process to continue with.
+ /// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator
+ /// to continue process for token exchange.
+ ///
+ IAuthenticator ExternalAuthenticationAuthenticator { get; set; }
- ///
- /// Returns all local accounts.
- ///
- /// All local accounts
- Task> GetAccountsAsync();
+ ///
+ /// Returns all local accounts.
+ ///
+ /// All local accounts
+ Task> GetAccountsAsync();
- ///
- /// Returns single MailAccount
- ///
- /// AccountId.
- Task GetAccountAsync(Guid accountId);
+ ///
+ /// Returns single MailAccount
+ ///
+ /// AccountId.
+ Task GetAccountAsync(Guid accountId);
- ///
- /// Deletes all information about the account, including token information.
- ///
- /// MailAccount to be removed
- Task DeleteAccountAsync(MailAccount account);
+ ///
+ /// Deletes all information about the account, including token information.
+ ///
+ /// MailAccount to be removed
+ Task DeleteAccountAsync(MailAccount account);
- ///
- /// Returns the custom server information for the given account id.
- ///
- Task GetAccountCustomServerInformationAsync(Guid accountId);
+ ///
+ /// Returns the custom server information for the given account id.
+ ///
+ Task GetAccountCustomServerInformationAsync(Guid accountId);
- ///
- /// Updates the given account properties.
- ///
- Task UpdateAccountAsync(MailAccount account);
+ ///
+ /// Updates the given account properties.
+ ///
+ Task UpdateAccountAsync(MailAccount account);
- ///
- /// Creates new account with the given server information if any.
- /// Also sets the account as Startup account if there are no accounts.
- ///
- Task CreateAccountAsync(MailAccount account, CustomServerInformation customServerInformation);
+ ///
+ /// Creates new account with the given server information if any.
+ /// Also sets the account as Startup account if there are no accounts.
+ ///
+ Task CreateAccountAsync(MailAccount account, CustomServerInformation customServerInformation);
- ///
- /// Fixed authentication errors for account by forcing interactive login.
- ///
- Task FixTokenIssuesAsync(Guid accountId);
+ ///
+ /// Fixed authentication errors for account by forcing interactive login.
+ ///
+ Task FixTokenIssuesAsync(Guid accountId);
- ///
- /// Removed the attention from an account.
- ///
- /// Account id to remove from
- Task ClearAccountAttentionAsync(Guid accountId);
+ ///
+ /// Removed the attention from an account.
+ ///
+ /// Account id to remove from
+ Task ClearAccountAttentionAsync(Guid accountId);
- ///
- /// Updates the account synchronization identifier.
- /// For example: Gmail uses this identifier to keep track of the last synchronization.
- /// Update is ignored for Gmail if the new identifier is older than the current one.
- ///
- /// Identifier to update
- /// Current account synchronization modifier.
- Task UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier);
+ ///
+ /// Updates the account synchronization identifier.
+ /// For example: Gmail uses this identifier to keep track of the last synchronization.
+ /// Update is ignored for Gmail if the new identifier is older than the current one.
+ ///
+ /// Identifier to update
+ /// Current account synchronization modifier.
+ Task UpdateSynchronizationIdentifierAsync(Guid accountId, string newIdentifier);
- ///
- /// Renames the merged inbox with the given id.
- ///
- /// Merged Inbox id
- /// New name for the merged/linked inbox.
- Task RenameMergedAccountAsync(Guid mergedInboxId, string newName);
+ ///
+ /// Renames the merged inbox with the given id.
+ ///
+ /// Merged Inbox id
+ /// New name for the merged/linked inbox.
+ Task RenameMergedAccountAsync(Guid mergedInboxId, string newName);
- ///
- /// Creates a new merged inbox with the given accounts.
- ///
- /// Merged inbox properties.
- /// List of accounts to merge together.
- Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable accountsToMerge);
+ ///
+ /// Creates a new merged inbox with the given accounts.
+ ///
+ /// Merged inbox properties.
+ /// List of accounts to merge together.
+ Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable accountsToMerge);
- ///
- /// Updates the merged inbox with the given id with the new linked accounts.
- ///
- /// Updating merged inbox id.
- /// List of linked account ids.
- Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable linkedAccountIds);
+ ///
+ /// Updates the merged inbox with the given id with the new linked accounts.
+ ///
+ /// Updating merged inbox id.
+ /// List of linked account ids.
+ Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable linkedAccountIds);
- ///
- /// Destroys the merged inbox with the given id.
- ///
- /// Merged inbox id to destroy.
- Task UnlinkMergedInboxAsync(Guid mergedInboxId);
+ ///
+ /// Destroys the merged inbox with the given id.
+ ///
+ /// Merged inbox id to destroy.
+ Task UnlinkMergedInboxAsync(Guid mergedInboxId);
- ///
- /// Updates the account listing orders.
- ///
- /// AccountId-OrderNumber pair for all accounts.
- Task UpdateAccountOrdersAsync(Dictionary accountIdOrderPair);
+ ///
+ /// Updates the account listing orders.
+ ///
+ /// AccountId-OrderNumber pair for all accounts.
+ Task UpdateAccountOrdersAsync(Dictionary accountIdOrderPair);
- ///
- /// Returns the account aliases.
- ///
- /// Account id.
- /// A list of MailAccountAlias that has e-mail aliases.
- Task> GetAccountAliasesAsync(Guid accountId);
+ ///
+ /// Returns the account aliases.
+ ///
+ /// Account id.
+ /// A list of MailAccountAlias that has e-mail aliases.
+ Task> GetAccountAliasesAsync(Guid accountId);
- ///
- /// Updated account's aliases.
- ///
- /// Account id to update aliases for.
- /// Full list of updated aliases.
- ///
- Task UpdateAccountAliasesAsync(Guid accountId, List aliases);
+ ///
+ /// Updated account's aliases.
+ ///
+ /// Account id to update aliases for.
+ /// Full list of updated aliases.
+ ///
+ Task UpdateAccountAliasesAsync(Guid accountId, List aliases);
- ///
- /// Delete account alias.
- ///
- /// Alias to remove.
- Task DeleteAccountAliasAsync(Guid aliasId);
+ ///
+ /// Delete account alias.
+ ///
+ /// Alias to remove.
+ Task DeleteAccountAliasAsync(Guid aliasId);
- ///
- /// Updated profile information of the account.
- ///
- /// Account id to update info for.
- /// Info data.
- ///
- Task UpdateProfileInformationAsync(Guid accountId, ProfileInformation profileInformation);
+ ///
+ /// Updated profile information of the account.
+ ///
+ /// Account id to update info for.
+ /// Info data.
+ ///
+ Task UpdateProfileInformationAsync(Guid accountId, ProfileInformation profileInformation);
- ///
- /// Creates a root + primary alias for the account.
- /// This is only called when the account is created.
- ///
- /// Account id.
- /// Address to create root primary alias from.
- Task CreateRootAliasAsync(Guid accountId, string address);
+ ///
+ /// Creates a root + primary alias for the account.
+ /// This is only called when the account is created.
+ ///
+ /// Account id.
+ /// Address to create root primary alias from.
+ Task CreateRootAliasAsync(Guid accountId, string address);
- ///
- /// Will compare local-remote aliases and update the local ones or add/delete new ones.
- ///
- /// Remotely fetched basic alias info from synchronizer.
- /// Account to update remote aliases for..
- Task UpdateRemoteAliasInformationAsync(MailAccount account, List remoteAccountAliases);
+ ///
+ /// Will compare local-remote aliases and update the local ones or add/delete new ones.
+ ///
+ /// Remotely fetched basic alias info from synchronizer.
+ /// Account to update remote aliases for..
+ Task UpdateRemoteAliasInformationAsync(MailAccount account, List remoteAccountAliases);
- ///
- /// Gets the primary account alias for the given account id.
- /// Used when creating draft messages.
- ///
- /// Account id.
- /// Primary alias for the account.
- Task GetPrimaryAccountAliasAsync(Guid accountId);
- Task IsAccountFocusedEnabledAsync(Guid accountId);
- }
+ ///
+ /// Gets the primary account alias for the given account id.
+ /// Used when creating draft messages.
+ ///
+ /// Account id.
+ /// Primary alias for the account.
+ Task GetPrimaryAccountAliasAsync(Guid accountId);
+ Task IsAccountFocusedEnabledAsync(Guid accountId);
}
diff --git a/Wino.Core.Domain/Interfaces/IApplicationConfiguration.cs b/Wino.Core.Domain/Interfaces/IApplicationConfiguration.cs
index b87c0a56..a47bdca3 100644
--- a/Wino.Core.Domain/Interfaces/IApplicationConfiguration.cs
+++ b/Wino.Core.Domain/Interfaces/IApplicationConfiguration.cs
@@ -1,32 +1,26 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// Singleton object that holds the application data folder path and the publisher shared folder path.
+/// Load the values before calling any service.
+/// App data folder is used for storing files.
+/// Pubhlisher cache folder is only used for database file so other apps can access it in the same package by same publisher.
+///
+public interface IApplicationConfiguration
{
///
- /// Singleton object that holds the application data folder path and the publisher shared folder path.
- /// Load the values before calling any service.
- /// App data folder is used for storing files.
- /// Pubhlisher cache folder is only used for database file so other apps can access it in the same package by same publisher.
+ /// Application data folder.
///
- public interface IApplicationConfiguration
- {
- ///
- /// Application data folder.
- ///
- string ApplicationDataFolderPath { get; set; }
+ string ApplicationDataFolderPath { get; set; }
- ///
- /// Publisher shared folder path.
- ///
- string PublisherSharedFolderPath { get; set; }
+ ///
+ /// Publisher shared folder path.
+ ///
+ string PublisherSharedFolderPath { get; set; }
- ///
- /// Temp folder path of the application.
- /// Files here are short-lived and can be deleted by system.
- ///
- string ApplicationTempFolderPath { get; set; }
-
- ///
- /// Application insights instrumentation key.
- ///
- string ApplicationInsightsInstrumentationKey { get; }
- }
+ ///
+ /// Temp folder path of the application.
+ /// Files here are short-lived and can be deleted by system.
+ ///
+ string ApplicationTempFolderPath { get; set; }
}
diff --git a/Wino.Core.Domain/Interfaces/IApplicationResourceManager.cs b/Wino.Core.Domain/Interfaces/IApplicationResourceManager.cs
index b96edb7c..f0a8f1dc 100644
--- a/Wino.Core.Domain/Interfaces/IApplicationResourceManager.cs
+++ b/Wino.Core.Domain/Interfaces/IApplicationResourceManager.cs
@@ -1,12 +1,11 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IApplicationResourceManager
{
- public interface IApplicationResourceManager
- {
- void RemoveResource(T resource);
- void AddResource(T resource);
- bool ContainsResourceKey(string resourceKey);
- void ReplaceResource(string resourceKey, object resource);
- T GetLastResource();
- TReturnType GetResource(string resourceKey);
- }
+ void RemoveResource(T resource);
+ void AddResource(T resource);
+ bool ContainsResourceKey(string resourceKey);
+ void ReplaceResource(string resourceKey, object resource);
+ T GetLastResource();
+ TReturnType GetResource(string resourceKey);
}
diff --git a/Wino.Core.Domain/Interfaces/IAuthenticationProvider.cs b/Wino.Core.Domain/Interfaces/IAuthenticationProvider.cs
index 49390dcb..652ac62b 100644
--- a/Wino.Core.Domain/Interfaces/IAuthenticationProvider.cs
+++ b/Wino.Core.Domain/Interfaces/IAuthenticationProvider.cs
@@ -1,9 +1,8 @@
using Wino.Core.Domain.Enums;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAuthenticationProvider
{
- public interface IAuthenticationProvider
- {
- IAuthenticator GetAuthenticator(MailProviderType providerType);
- }
+ IAuthenticator GetAuthenticator(MailProviderType providerType);
}
diff --git a/Wino.Core.Domain/Interfaces/IAuthenticator.cs b/Wino.Core.Domain/Interfaces/IAuthenticator.cs
index 86d2f8b4..837b99f9 100644
--- a/Wino.Core.Domain/Interfaces/IAuthenticator.cs
+++ b/Wino.Core.Domain/Interfaces/IAuthenticator.cs
@@ -3,37 +3,36 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Authentication;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAuthenticator
{
- public interface IAuthenticator
- {
- ///
- /// Type of the provider.
- ///
- MailProviderType ProviderType { get; }
+ ///
+ /// Type of the provider.
+ ///
+ MailProviderType ProviderType { get; }
- Task GetTokenInformationAsync(MailAccount account);
+ Task GetTokenInformationAsync(MailAccount account);
- Task GenerateTokenInformationAsync(MailAccount account);
+ Task GenerateTokenInformationAsync(MailAccount account);
- /////
- ///// Gets the token for the given account from the cache.
- ///// Forces interactive login if the token is not found.
- /////
- ///// Account to get access token for.
- ///// Access token
- //Task GetTokenAsync(MailAccount account);
+ /////
+ ///// Gets the token for the given account from the cache.
+ ///// Forces interactive login if the token is not found.
+ /////
+ ///// Account to get access token for.
+ ///// Access token
+ //Task GetTokenAsync(MailAccount account);
- /////
- ///// Forces an interactive login to get the token for the given account.
- /////
- ///// Account to get access token for.
- ///// Access token
- //// Task GenerateTokenAsync(MailAccount account);
+ /////
+ ///// Forces an interactive login to get the token for the given account.
+ /////
+ ///// Account to get access token for.
+ ///// Access token
+ //// Task GenerateTokenAsync(MailAccount account);
- /////
- ///// ClientId in case of needed for authorization/authentication.
- /////
- //string ClientId { get; }
- }
+ /////
+ ///// ClientId in case of needed for authorization/authentication.
+ /////
+ //string ClientId { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAuthenticatorConfig.cs b/Wino.Core.Domain/Interfaces/IAuthenticatorConfig.cs
index 1f154727..a867fee7 100644
--- a/Wino.Core.Domain/Interfaces/IAuthenticatorConfig.cs
+++ b/Wino.Core.Domain/Interfaces/IAuthenticatorConfig.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IAuthenticatorConfig
{
- public interface IAuthenticatorConfig
- {
- string OutlookAuthenticatorClientId { get; }
- string[] OutlookScope { get; }
- string GmailAuthenticatorClientId { get; }
- string[] GmailScope { get; }
- string GmailTokenStoreIdentifier { get; }
- }
+ string OutlookAuthenticatorClientId { get; }
+ string[] OutlookScope { get; }
+ string GmailAuthenticatorClientId { get; }
+ string[] GmailScope { get; }
+ string GmailTokenStoreIdentifier { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/IAuthenticatorTypes.cs b/Wino.Core.Domain/Interfaces/IAuthenticatorTypes.cs
index ef842706..a6d25aff 100644
--- a/Wino.Core.Domain/Interfaces/IAuthenticatorTypes.cs
+++ b/Wino.Core.Domain/Interfaces/IAuthenticatorTypes.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IOutlookAuthenticator : IAuthenticator { }
- public interface IGmailAuthenticator : IAuthenticator
- {
- bool ProposeCopyAuthURL { get; set; }
- }
+namespace Wino.Core.Domain.Interfaces;
- public interface IImapAuthenticator : IAuthenticator { }
+public interface IOutlookAuthenticator : IAuthenticator { }
+public interface IGmailAuthenticator : IAuthenticator
+{
+ bool ProposeCopyAuthURL { get; set; }
}
+
+public interface IImapAuthenticator : IAuthenticator { }
diff --git a/Wino.Core.Domain/Interfaces/IAutoDiscoveryService.cs b/Wino.Core.Domain/Interfaces/IAutoDiscoveryService.cs
index 6886022d..0ba6642a 100644
--- a/Wino.Core.Domain/Interfaces/IAutoDiscoveryService.cs
+++ b/Wino.Core.Domain/Interfaces/IAutoDiscoveryService.cs
@@ -1,18 +1,17 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Models.AutoDiscovery;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// Searches for Auto Discovery settings for custom mail accounts.
+///
+public interface IAutoDiscoveryService
{
///
- /// Searches for Auto Discovery settings for custom mail accounts.
+ /// Tries to return the best mail server settings using different techniques.
///
- public interface IAutoDiscoveryService
- {
- ///
- /// Tries to return the best mail server settings using different techniques.
- ///
- /// Address to search settings for.
- /// CustomServerInformation with only settings applied.
- Task GetAutoDiscoverySettings(AutoDiscoveryMinimalSettings autoDiscoveryMinimalSettings);
- }
+ /// Address to search settings for.
+ /// CustomServerInformation with only settings applied.
+ Task GetAutoDiscoverySettings(AutoDiscoveryMinimalSettings autoDiscoveryMinimalSettings);
}
diff --git a/Wino.Core.Domain/Interfaces/IBackgroundTaskService.cs b/Wino.Core.Domain/Interfaces/IBackgroundTaskService.cs
index 53fb80b3..651ee659 100644
--- a/Wino.Core.Domain/Interfaces/IBackgroundTaskService.cs
+++ b/Wino.Core.Domain/Interfaces/IBackgroundTaskService.cs
@@ -1,18 +1,17 @@
using System.Threading.Tasks;
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IBackgroundTaskService
- {
- ///
- /// Unregisters all background tasks once.
- /// This is used to clean up the background tasks when the app is updated.
- ///
- void UnregisterAllBackgroundTask();
+namespace Wino.Core.Domain.Interfaces;
- ///
- /// Registers required background tasks.
- ///
- Task RegisterBackgroundTasksAsync();
- }
+public interface IBackgroundTaskService
+{
+ ///
+ /// Unregisters all background tasks once.
+ /// This is used to clean up the background tasks when the app is updated.
+ ///
+ void UnregisterAllBackgroundTask();
+
+ ///
+ /// Registers required background tasks.
+ ///
+ Task RegisterBackgroundTasksAsync();
}
diff --git a/Wino.Core.Domain/Interfaces/IBaseSynchronizer.cs b/Wino.Core.Domain/Interfaces/IBaseSynchronizer.cs
index 09e2b402..00f2f406 100644
--- a/Wino.Core.Domain/Interfaces/IBaseSynchronizer.cs
+++ b/Wino.Core.Domain/Interfaces/IBaseSynchronizer.cs
@@ -3,31 +3,30 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Accounts;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IBaseSynchronizer
{
- public interface IBaseSynchronizer
- {
- ///
- /// Account that is assigned for this synchronizer.
- ///
- MailAccount Account { get; }
+ ///
+ /// Account that is assigned for this synchronizer.
+ ///
+ MailAccount Account { get; }
- ///
- /// Synchronizer state.
- ///
- AccountSynchronizerState State { get; }
+ ///
+ /// Synchronizer state.
+ ///
+ AccountSynchronizerState State { get; }
- ///
- /// Queues a single request to be executed in the next synchronization.
- ///
- /// Request to queue.
- void QueueRequest(IRequestBase request);
+ ///
+ /// Queues a single request to be executed in the next synchronization.
+ ///
+ /// Request to queue.
+ void QueueRequest(IRequestBase request);
- ///
- /// Synchronizes profile information with the server.
- /// Sender name and Profile picture are updated.
- ///
- /// Profile information model that holds the values.
- Task GetProfileInformationAsync();
- }
+ ///
+ /// Synchronizes profile information with the server.
+ /// Sender name and Profile picture are updated.
+ ///
+ /// Profile information model that holds the values.
+ Task GetProfileInformationAsync();
}
diff --git a/Wino.Core.Domain/Interfaces/ICalendarDialogService.cs b/Wino.Core.Domain/Interfaces/ICalendarDialogService.cs
index 023d9eaf..7b48f868 100644
--- a/Wino.Core.Domain/Interfaces/ICalendarDialogService.cs
+++ b/Wino.Core.Domain/Interfaces/ICalendarDialogService.cs
@@ -1,6 +1,5 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface ICalendarDialogService : IDialogServiceBase
{
- public interface ICalendarDialogService : IDialogServiceBase
- {
- }
}
diff --git a/Wino.Core.Domain/Interfaces/ICalendarItem.cs b/Wino.Core.Domain/Interfaces/ICalendarItem.cs
index 815b4a22..e83827a6 100644
--- a/Wino.Core.Domain/Interfaces/ICalendarItem.cs
+++ b/Wino.Core.Domain/Interfaces/ICalendarItem.cs
@@ -1,23 +1,22 @@
using System;
using Itenso.TimePeriod;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface ICalendarItem
{
- public interface ICalendarItem
- {
- string Title { get; }
- Guid Id { get; }
- IAccountCalendar AssignedCalendar { get; }
- DateTime StartDate { get; set; }
- DateTime EndDate { get; }
- double DurationInSeconds { get; set; }
- ITimePeriod Period { get; }
+ string Title { get; }
+ Guid Id { get; }
+ IAccountCalendar AssignedCalendar { get; }
+ DateTime StartDate { get; set; }
+ DateTime EndDate { get; }
+ double DurationInSeconds { get; set; }
+ ITimePeriod Period { get; }
- bool IsAllDayEvent { get; }
- bool IsMultiDayEvent { get; }
+ bool IsAllDayEvent { get; }
+ bool IsMultiDayEvent { get; }
- bool IsRecurringChild { get; }
- bool IsRecurringParent { get; }
- bool IsRecurringEvent { get; }
- }
+ bool IsRecurringChild { get; }
+ bool IsRecurringParent { get; }
+ bool IsRecurringEvent { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/ICalendarItemViewModel.cs b/Wino.Core.Domain/Interfaces/ICalendarItemViewModel.cs
index 6c2a4de6..3eaf1ff7 100644
--- a/Wino.Core.Domain/Interfaces/ICalendarItemViewModel.cs
+++ b/Wino.Core.Domain/Interfaces/ICalendarItemViewModel.cs
@@ -1,10 +1,9 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// Temporarily to enforce CalendarItemViewModel. Used in CalendarEventCollection.
+///
+public interface ICalendarItemViewModel
{
- ///
- /// Temporarily to enforce CalendarItemViewModel. Used in CalendarEventCollection.
- ///
- public interface ICalendarItemViewModel
- {
- bool IsSelected { get; set; }
- }
+ bool IsSelected { get; set; }
}
diff --git a/Wino.Core.Domain/Interfaces/ICalendarService.cs b/Wino.Core.Domain/Interfaces/ICalendarService.cs
index 6c4a93f3..f0e18b4a 100644
--- a/Wino.Core.Domain/Interfaces/ICalendarService.cs
+++ b/Wino.Core.Domain/Interfaces/ICalendarService.cs
@@ -4,29 +4,28 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Calendar;
using Wino.Core.Domain.Models.Calendar;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface ICalendarService
{
- public interface ICalendarService
- {
- Task> GetAccountCalendarsAsync(Guid accountId);
- Task GetAccountCalendarAsync(Guid accountCalendarId);
- Task DeleteCalendarItemAsync(Guid calendarItemId);
+ Task> GetAccountCalendarsAsync(Guid accountId);
+ Task GetAccountCalendarAsync(Guid accountCalendarId);
+ Task DeleteCalendarItemAsync(Guid calendarItemId);
- Task DeleteAccountCalendarAsync(AccountCalendar accountCalendar);
- Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
- Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
- Task CreateNewCalendarItemAsync(CalendarItem calendarItem, List attendees);
- Task> GetCalendarEventsAsync(IAccountCalendar calendar, DayRangeRenderModel dayRangeRenderModel);
- Task GetCalendarItemAsync(Guid accountCalendarId, string remoteEventId);
- Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken);
+ Task DeleteAccountCalendarAsync(AccountCalendar accountCalendar);
+ Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
+ Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
+ Task CreateNewCalendarItemAsync(CalendarItem calendarItem, List attendees);
+ Task> GetCalendarEventsAsync(IAccountCalendar calendar, DayRangeRenderModel dayRangeRenderModel);
+ Task GetCalendarItemAsync(Guid accountCalendarId, string remoteEventId);
+ Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken);
- ///
- /// Returns the correct calendar item based on the target details.
- ///
- /// Target details.
- Task GetCalendarItemTargetAsync(CalendarItemTarget targetDetails);
- Task GetCalendarItemAsync(Guid id);
- Task> GetAttendeesAsync(Guid calendarEventTrackingId);
- Task> ManageEventAttendeesAsync(Guid calendarItemId, List allAttendees);
- }
+ ///
+ /// Returns the correct calendar item based on the target details.
+ ///
+ /// Target details.
+ Task GetCalendarItemTargetAsync(CalendarItemTarget targetDetails);
+ Task GetCalendarItemAsync(Guid id);
+ Task> GetAttendeesAsync(Guid calendarEventTrackingId);
+ Task> ManageEventAttendeesAsync(Guid calendarItemId, List allAttendees);
}
diff --git a/Wino.Core.Domain/Interfaces/IClientMessage.cs b/Wino.Core.Domain/Interfaces/IClientMessage.cs
index 5244059e..9dd64bca 100644
--- a/Wino.Core.Domain/Interfaces/IClientMessage.cs
+++ b/Wino.Core.Domain/Interfaces/IClientMessage.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Interfaces
-{
- ///
- /// All messages that Client sends to Server and awaits a response in return.
- /// For example; triggering a new synchronization request.
- ///
- public interface IClientMessage;
-}
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// All messages that Client sends to Server and awaits a response in return.
+/// For example; triggering a new synchronization request.
+///
+public interface IClientMessage;
diff --git a/Wino.Core.Domain/Interfaces/IClipboardService.cs b/Wino.Core.Domain/Interfaces/IClipboardService.cs
index f5bb4782..ef2ab61a 100644
--- a/Wino.Core.Domain/Interfaces/IClipboardService.cs
+++ b/Wino.Core.Domain/Interfaces/IClipboardService.cs
@@ -1,9 +1,8 @@
using System.Threading.Tasks;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IClipboardService
{
- public interface IClipboardService
- {
- Task CopyClipboardAsync(string text);
- }
+ Task CopyClipboardAsync(string text);
}
diff --git a/Wino.Core.Domain/Interfaces/IConfigurationService.cs b/Wino.Core.Domain/Interfaces/IConfigurationService.cs
index c08c463c..a32410d6 100644
--- a/Wino.Core.Domain/Interfaces/IConfigurationService.cs
+++ b/Wino.Core.Domain/Interfaces/IConfigurationService.cs
@@ -1,11 +1,10 @@
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IConfigurationService
- {
- void Set(string key, object value);
- T Get(string key, T defaultValue = default);
+namespace Wino.Core.Domain.Interfaces;
- void SetRoaming(string key, object value);
- T GetRoaming(string key, T defaultValue = default);
- }
+public interface IConfigurationService
+{
+ void Set(string key, object value);
+ T Get(string key, T defaultValue = default);
+
+ void SetRoaming(string key, object value);
+ T GetRoaming(string key, T defaultValue = default);
}
diff --git a/Wino.Core.Domain/Interfaces/IContactService.cs b/Wino.Core.Domain/Interfaces/IContactService.cs
index e9e1df7d..e721ec2a 100644
--- a/Wino.Core.Domain/Interfaces/IContactService.cs
+++ b/Wino.Core.Domain/Interfaces/IContactService.cs
@@ -3,13 +3,12 @@ using System.Threading.Tasks;
using MimeKit;
using Wino.Core.Domain.Entities.Shared;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IContactService
{
- public interface IContactService
- {
- Task> GetAddressInformationAsync(string queryText);
- Task GetAddressInformationByAddressAsync(string address);
- Task SaveAddressInformationAsync(MimeMessage message);
- Task CreateNewContactAsync(string address, string displayName);
- }
+ Task> GetAddressInformationAsync(string queryText);
+ Task GetAddressInformationByAddressAsync(string address);
+ Task SaveAddressInformationAsync(MimeMessage message);
+ Task CreateNewContactAsync(string address, string displayName);
}
diff --git a/Wino.Core.Domain/Interfaces/IContextMenuItemService.cs b/Wino.Core.Domain/Interfaces/IContextMenuItemService.cs
index 06d91240..c3b1c54d 100644
--- a/Wino.Core.Domain/Interfaces/IContextMenuItemService.cs
+++ b/Wino.Core.Domain/Interfaces/IContextMenuItemService.cs
@@ -3,12 +3,11 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IContextMenuItemService
{
- public interface IContextMenuItemService
- {
- IEnumerable GetFolderContextMenuActions(IBaseFolderMenuItem folderInformation);
- IEnumerable GetMailItemContextMenuActions(IEnumerable selectedMailItems);
- IEnumerable GetMailItemRenderMenuActions(IMailItem mailItem, bool isDarkEditor);
- }
+ IEnumerable GetFolderContextMenuActions(IBaseFolderMenuItem folderInformation);
+ IEnumerable GetMailItemContextMenuActions(IEnumerable selectedMailItems);
+ IEnumerable GetMailItemRenderMenuActions(IMailItem mailItem, bool isDarkEditor);
}
diff --git a/Wino.Core.Domain/Interfaces/IContextMenuProvider.cs b/Wino.Core.Domain/Interfaces/IContextMenuProvider.cs
index 968b2c2c..7e7ef089 100644
--- a/Wino.Core.Domain/Interfaces/IContextMenuProvider.cs
+++ b/Wino.Core.Domain/Interfaces/IContextMenuProvider.cs
@@ -3,28 +3,27 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Menus;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IContextMenuProvider
{
- public interface IContextMenuProvider
- {
- ///
- /// Calculates and returns available folder operations for the given folder.
- ///
- /// Folder to get actions for.
- IEnumerable GetFolderContextMenuActions(IMailItemFolder folderInformation);
+ ///
+ /// Calculates and returns available folder operations for the given folder.
+ ///
+ /// Folder to get actions for.
+ IEnumerable GetFolderContextMenuActions(IMailItemFolder folderInformation);
- ///
- /// Calculates and returns available context menu items for selected mail items.
- ///
- /// Current folder that asks for the menu items.
- /// Selected menu items in the given folder.
- IEnumerable GetMailItemContextMenuActions(IMailItemFolder folderInformation, IEnumerable selectedMailItems);
+ ///
+ /// Calculates and returns available context menu items for selected mail items.
+ ///
+ /// Current folder that asks for the menu items.
+ /// Selected menu items in the given folder.
+ IEnumerable GetMailItemContextMenuActions(IMailItemFolder folderInformation, IEnumerable selectedMailItems);
- ///
- /// Calculates and returns available mail operations for mail rendering CommandBar.
- ///
- /// Rendered mail item.
- /// Folder that mail item belongs to.
- IEnumerable GetMailItemRenderMenuActions(IMailItem mailItem, IMailItemFolder activeFolder, bool isDarkEditor);
- }
+ ///
+ /// Calculates and returns available mail operations for mail rendering CommandBar.
+ ///
+ /// Rendered mail item.
+ /// Folder that mail item belongs to.
+ IEnumerable GetMailItemRenderMenuActions(IMailItem mailItem, IMailItemFolder activeFolder, bool isDarkEditor);
}
diff --git a/Wino.Core.Domain/Interfaces/ICreateAccountAliasDialog.cs b/Wino.Core.Domain/Interfaces/ICreateAccountAliasDialog.cs
index 35341304..d787fe3d 100644
--- a/Wino.Core.Domain/Interfaces/ICreateAccountAliasDialog.cs
+++ b/Wino.Core.Domain/Interfaces/ICreateAccountAliasDialog.cs
@@ -1,9 +1,8 @@
using Wino.Core.Domain.Entities.Mail;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface ICreateAccountAliasDialog
{
- public interface ICreateAccountAliasDialog
- {
- public MailAccountAlias CreatedAccountAlias { get; set; }
- }
+ public MailAccountAlias CreatedAccountAlias { get; set; }
}
diff --git a/Wino.Core.Domain/Interfaces/ICustomFolderSynchronizationRequest.cs b/Wino.Core.Domain/Interfaces/ICustomFolderSynchronizationRequest.cs
index 36c90040..ae756a92 100644
--- a/Wino.Core.Domain/Interfaces/ICustomFolderSynchronizationRequest.cs
+++ b/Wino.Core.Domain/Interfaces/ICustomFolderSynchronizationRequest.cs
@@ -1,22 +1,21 @@
using System;
using System.Collections.Generic;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// An interface that should force synchronizer to do synchronization for only given folder ids
+/// after the execution is completed.
+///
+public interface ICustomFolderSynchronizationRequest
{
///
- /// An interface that should force synchronizer to do synchronization for only given folder ids
- /// after the execution is completed.
+ /// Which folders to sync after this operation?
///
- public interface ICustomFolderSynchronizationRequest
- {
- ///
- /// Which folders to sync after this operation?
- ///
- List SynchronizationFolderIds { get; }
+ List SynchronizationFolderIds { get; }
- ///
- /// If true, additional folders like Sent, Drafts and Deleted will not be synchronized
- ///
- bool ExcludeMustHaveFolders { get; }
- }
+ ///
+ /// If true, additional folders like Sent, Drafts and Deleted will not be synchronized
+ ///
+ bool ExcludeMustHaveFolders { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs b/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs
index 42789f42..ba2cbf0b 100644
--- a/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs
+++ b/Wino.Core.Domain/Interfaces/IDialogServiceBase.cs
@@ -6,29 +6,28 @@ using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Accounts;
using Wino.Core.Domain.Models.Common;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IDialogServiceBase
{
- public interface IDialogServiceBase
- {
- Task PickWindowsFolderAsync();
- Task PickWindowsFileContentAsync(params object[] typeFilters);
- Task ShowConfirmationDialogAsync(string question, string title, string confirmationButtonTitle);
- Task ShowMessageAsync(string message, string title, WinoCustomMessageDialogIcon icon);
- void InfoBarMessage(string title, string message, InfoBarMessageType messageType);
- void InfoBarMessage(string title, string message, InfoBarMessageType messageType, string actionButtonText, Action action);
- void ShowNotSupportedMessage();
- Task ShowEditAccountDialogAsync(MailAccount account);
- Task ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription, string primaryButtonText);
- Task ShowWinoCustomMessageDialogAsync(string title,
- string description,
- string approveButtonText,
- WinoCustomMessageDialogIcon? icon,
- string cancelButtonText = "",
- string dontAskAgainConfigurationKey = "");
- Task ShowCustomThemeBuilderDialogAsync();
- Task ShowAccountProviderSelectionDialogAsync(List availableProviders);
- IAccountCreationDialog GetAccountCreationDialog(AccountCreationDialogResult accountCreationDialogResult);
- Task> PickFilesAsync(params object[] typeFilters);
- Task PickFilePathAsync(string saveFileName);
- }
+ Task PickWindowsFolderAsync();
+ Task PickWindowsFileContentAsync(params object[] typeFilters);
+ Task ShowConfirmationDialogAsync(string question, string title, string confirmationButtonTitle);
+ Task ShowMessageAsync(string message, string title, WinoCustomMessageDialogIcon icon);
+ void InfoBarMessage(string title, string message, InfoBarMessageType messageType);
+ void InfoBarMessage(string title, string message, InfoBarMessageType messageType, string actionButtonText, Action action);
+ void ShowNotSupportedMessage();
+ Task ShowEditAccountDialogAsync(MailAccount account);
+ Task ShowTextInputDialogAsync(string currentInput, string dialogTitle, string dialogDescription, string primaryButtonText);
+ Task ShowWinoCustomMessageDialogAsync(string title,
+ string description,
+ string approveButtonText,
+ WinoCustomMessageDialogIcon? icon,
+ string cancelButtonText = "",
+ string dontAskAgainConfigurationKey = "");
+ Task ShowCustomThemeBuilderDialogAsync();
+ Task ShowAccountProviderSelectionDialogAsync(List availableProviders);
+ IAccountCreationDialog GetAccountCreationDialog(AccountCreationDialogResult accountCreationDialogResult);
+ Task> PickFilesAsync(params object[] typeFilters);
+ Task PickFilePathAsync(string saveFileName);
}
diff --git a/Wino.Core.Domain/Interfaces/IDispatcher.cs b/Wino.Core.Domain/Interfaces/IDispatcher.cs
index 0eb9f08b..b6fb1dd3 100644
--- a/Wino.Core.Domain/Interfaces/IDispatcher.cs
+++ b/Wino.Core.Domain/Interfaces/IDispatcher.cs
@@ -1,10 +1,9 @@
using System;
using System.Threading.Tasks;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IDispatcher
{
- public interface IDispatcher
- {
- Task ExecuteOnUIThread(Action action);
- }
+ Task ExecuteOnUIThread(Action action);
}
diff --git a/Wino.Core.Domain/Interfaces/IFileService.cs b/Wino.Core.Domain/Interfaces/IFileService.cs
index 6fbe5d96..6b47a99c 100644
--- a/Wino.Core.Domain/Interfaces/IFileService.cs
+++ b/Wino.Core.Domain/Interfaces/IFileService.cs
@@ -1,20 +1,19 @@
using System.IO;
using System.Threading.Tasks;
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IFileService
- {
- Task CopyFileAsync(string sourceFilePath, string destinationFolderPath);
- Task GetFileStreamAsync(string folderPath, string fileName);
- Task GetFileContentByApplicationUriAsync(string resourcePath);
+namespace Wino.Core.Domain.Interfaces;
- ///
- /// Zips all existing logs and saves to picked destination folder.
- ///
- /// Folder path where logs are stored.
- /// Target path to save the archive file.
- /// True if zip is created with at least one item, false if logs are not found.
- Task SaveLogsToFolderAsync(string logsFolder, string destinationFolder);
- }
+public interface IFileService
+{
+ Task CopyFileAsync(string sourceFilePath, string destinationFolderPath);
+ Task GetFileStreamAsync(string folderPath, string fileName);
+ Task GetFileContentByApplicationUriAsync(string resourcePath);
+
+ ///
+ /// Zips all existing logs and saves to picked destination folder.
+ ///
+ /// Folder path where logs are stored.
+ /// Target path to save the archive file.
+ /// True if zip is created with at least one item, false if logs are not found.
+ Task SaveLogsToFolderAsync(string logsFolder, string destinationFolder);
}
diff --git a/Wino.Core.Domain/Interfaces/IFolderMenuItem.cs b/Wino.Core.Domain/Interfaces/IFolderMenuItem.cs
index 6c1fdf33..7deff38d 100644
--- a/Wino.Core.Domain/Interfaces/IFolderMenuItem.cs
+++ b/Wino.Core.Domain/Interfaces/IFolderMenuItem.cs
@@ -3,30 +3,29 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IFolderMenuItem : IBaseFolderMenuItem
{
- public interface IFolderMenuItem : IBaseFolderMenuItem
- {
- MailAccount ParentAccount { get; }
- void UpdateParentAccounnt(MailAccount account);
- }
-
- public interface IMergedAccountFolderMenuItem : IBaseFolderMenuItem { }
-
- public interface IBaseFolderMenuItem : IMenuItem
- {
- string FolderName { get; }
- bool IsSynchronizationEnabled { get; }
- int UnreadItemCount { get; set; }
- SpecialFolderType SpecialFolderType { get; }
- IEnumerable HandlingFolders { get; }
- IEnumerable SubMenuItems { get; }
- bool IsMoveTarget { get; }
- bool IsSticky { get; }
- bool IsSystemFolder { get; }
- bool ShowUnreadCount { get; }
- string AssignedAccountName { get; }
-
- void UpdateFolder(IMailItemFolder folder);
- }
+ MailAccount ParentAccount { get; }
+ void UpdateParentAccounnt(MailAccount account);
+}
+
+public interface IMergedAccountFolderMenuItem : IBaseFolderMenuItem { }
+
+public interface IBaseFolderMenuItem : IMenuItem
+{
+ string FolderName { get; }
+ bool IsSynchronizationEnabled { get; }
+ int UnreadItemCount { get; set; }
+ SpecialFolderType SpecialFolderType { get; }
+ IEnumerable HandlingFolders { get; }
+ IEnumerable SubMenuItems { get; }
+ bool IsMoveTarget { get; }
+ bool IsSticky { get; }
+ bool IsSystemFolder { get; }
+ bool ShowUnreadCount { get; }
+ string AssignedAccountName { get; }
+
+ void UpdateFolder(IMailItemFolder folder);
}
diff --git a/Wino.Core.Domain/Interfaces/IFolderService.cs b/Wino.Core.Domain/Interfaces/IFolderService.cs
index c7a27a87..33cf1f35 100644
--- a/Wino.Core.Domain/Interfaces/IFolderService.cs
+++ b/Wino.Core.Domain/Interfaces/IFolderService.cs
@@ -9,87 +9,86 @@ using Wino.Core.Domain.Models.Folders;
using Wino.Core.Domain.Models.MailItem;
using Wino.Core.Domain.Models.Synchronization;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IFolderService
{
- public interface IFolderService
- {
- Task GetFolderStructureForAccountAsync(Guid accountId, bool includeHiddenFolders);
- Task GetFolderAsync(Guid folderId);
- Task GetFolderAsync(Guid accountId, string remoteFolderId);
- Task> GetFoldersAsync(Guid accountId);
- Task GetSpecialFolderByAccountIdAsync(Guid accountId, SpecialFolderType type);
- Task GetCurrentItemCountForFolder(Guid folderId);
- Task GetFolderNotificationBadgeAsync(Guid folderId);
- Task ChangeStickyStatusAsync(Guid folderId, bool isSticky);
+ Task GetFolderStructureForAccountAsync(Guid accountId, bool includeHiddenFolders);
+ Task GetFolderAsync(Guid folderId);
+ Task GetFolderAsync(Guid accountId, string remoteFolderId);
+ Task> GetFoldersAsync(Guid accountId);
+ Task GetSpecialFolderByAccountIdAsync(Guid accountId, SpecialFolderType type);
+ Task GetCurrentItemCountForFolder(Guid folderId);
+ Task GetFolderNotificationBadgeAsync(Guid folderId);
+ Task ChangeStickyStatusAsync(Guid folderId, bool isSticky);
- Task UpdateSystemFolderConfigurationAsync(Guid accountId, SystemFolderConfiguration configuration);
- Task ChangeFolderSynchronizationStateAsync(Guid folderId, bool isSynchronizationEnabled);
- Task ChangeFolderShowUnreadCountStateAsync(Guid folderId, bool showUnreadCount);
+ Task UpdateSystemFolderConfigurationAsync(Guid accountId, SystemFolderConfiguration configuration);
+ Task ChangeFolderSynchronizationStateAsync(Guid folderId, bool isSynchronizationEnabled);
+ Task ChangeFolderShowUnreadCountStateAsync(Guid folderId, bool showUnreadCount);
- Task> GetSynchronizationFoldersAsync(MailSynchronizationOptions options);
+ Task> GetSynchronizationFoldersAsync(MailSynchronizationOptions options);
- ///
- /// Returns the folder - mail mapping for the given mail copy ids.
- ///
- Task> GetMailFolderPairMetadatasAsync(IEnumerable mailCopyIds);
+ ///
+ /// Returns the folder - mail mapping for the given mail copy ids.
+ ///
+ Task> GetMailFolderPairMetadatasAsync(IEnumerable mailCopyIds);
- ///
- /// Returns the folder - mail mapping for the given mail copy id.
- ///
- Task> GetMailFolderPairMetadatasAsync(string mailCopyId);
+ ///
+ /// Returns the folder - mail mapping for the given mail copy id.
+ ///
+ Task> GetMailFolderPairMetadatasAsync(string mailCopyId);
- ///
- /// Deletes the folder for the given account by remote folder id.
- ///
- /// Account to remove from.
- /// Remote folder id.
- ///
- Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
+ ///
+ /// Deletes the folder for the given account by remote folder id.
+ ///
+ /// Account to remove from.
+ /// Remote folder id.
+ ///
+ Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
- ///
- /// Adds a new folder.
- ///
- /// Folder to add.
- Task InsertFolderAsync(MailItemFolder folder);
+ ///
+ /// Adds a new folder.
+ ///
+ /// Folder to add.
+ Task InsertFolderAsync(MailItemFolder folder);
- ///
- /// Returns the known uids for the given folder.
- /// Only used for IMAP
- ///
- /// Folder to get uIds for
- Task> GetKnownUidsForFolderAsync(Guid folderId);
+ ///
+ /// Returns the known uids for the given folder.
+ /// Only used for IMAP
+ ///
+ /// Folder to get uIds for
+ Task> GetKnownUidsForFolderAsync(Guid folderId);
- ///
- /// Checks if Inbox special folder exists for an account.
- ///
- /// Account id to check for.
- /// True if Inbox exists, False if not.
- Task IsInboxAvailableForAccountAsync(Guid accountId);
+ ///
+ /// Checks if Inbox special folder exists for an account.
+ ///
+ /// Account id to check for.
+ /// True if Inbox exists, False if not.
+ Task IsInboxAvailableForAccountAsync(Guid accountId);
- ///
- /// Updates folder's LastSynchronizedDate to now.
- ///
- /// Folder to update.
- Task UpdateFolderLastSyncDateAsync(Guid folderId);
+ ///
+ /// Updates folder's LastSynchronizedDate to now.
+ ///
+ /// Folder to update.
+ Task UpdateFolderLastSyncDateAsync(Guid folderId);
- ///
- /// Updates the given folder.
- ///
- /// Folder to update.
- Task UpdateFolderAsync(MailItemFolder folder);
+ ///
+ /// Updates the given folder.
+ ///
+ /// Folder to update.
+ Task UpdateFolderAsync(MailItemFolder folder);
- ///
- /// Returns the active folder menu items for the given account for UI.
- ///
- /// Account to get folder menu items for.
- Task> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem);
+ ///
+ /// Returns the active folder menu items for the given account for UI.
+ ///
+ /// Account to get folder menu items for.
+ Task> GetAccountFoldersForDisplayAsync(IAccountMenuItem accountMenuItem);
- ///
- /// Returns a list of unread item counts for the given account ids.
- /// Every folder that is marked as show unread badge is included.
- ///
- /// Account ids to get unread folder counts for.
- Task> GetUnreadItemCountResultsAsync(IEnumerable accountIds);
- }
+ ///
+ /// Returns a list of unread item counts for the given account ids.
+ /// Every folder that is marked as show unread badge is included.
+ ///
+ /// Account ids to get unread folder counts for.
+ Task> GetUnreadItemCountResultsAsync(IEnumerable accountIds);
}
diff --git a/Wino.Core.Domain/Interfaces/IFontService.cs b/Wino.Core.Domain/Interfaces/IFontService.cs
index ac938bd9..ac2d3249 100644
--- a/Wino.Core.Domain/Interfaces/IFontService.cs
+++ b/Wino.Core.Domain/Interfaces/IFontService.cs
@@ -1,16 +1,15 @@
using System.Collections.Generic;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// Service to access available fonts.
+///
+public interface IFontService
{
///
- /// Service to access available fonts.
+ /// Get available fonts. Default + installed system fonts.
+ /// Fonts initialized only once. To refresh fonts, restart the application.
///
- public interface IFontService
- {
- ///
- /// Get available fonts. Default + installed system fonts.
- /// Fonts initialized only once. To refresh fonts, restart the application.
- ///
- List GetFonts();
- }
+ List GetFonts();
}
diff --git a/Wino.Core.Domain/Interfaces/IGmailThreadingStrategy.cs b/Wino.Core.Domain/Interfaces/IGmailThreadingStrategy.cs
index 2348d8b2..17ec3b74 100644
--- a/Wino.Core.Domain/Interfaces/IGmailThreadingStrategy.cs
+++ b/Wino.Core.Domain/Interfaces/IGmailThreadingStrategy.cs
@@ -1,4 +1,3 @@
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IGmailThreadingStrategy : IThreadingStrategy { }
-}
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IGmailThreadingStrategy : IThreadingStrategy { }
diff --git a/Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs b/Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs
index 9230aec0..21d9fb47 100644
--- a/Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs
+++ b/Wino.Core.Domain/Interfaces/IImapAccountCreationDialog.cs
@@ -1,25 +1,24 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Shared;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IImapAccountCreationDialog : IAccountCreationDialog
{
- public interface IImapAccountCreationDialog : IAccountCreationDialog
- {
- ///
- /// Returns the custom server information from the dialog..
- ///
- /// Null if canceled.
- Task GetCustomServerInformationAsync();
+ ///
+ /// Returns the custom server information from the dialog..
+ ///
+ /// Null if canceled.
+ Task GetCustomServerInformationAsync();
- ///
- /// Displays preparing folders page.
- ///
- void ShowPreparingFolders();
+ ///
+ /// Displays preparing folders page.
+ ///
+ void ShowPreparingFolders();
- ///
- /// Updates account properties for the welcome imap setup dialog and starts the setup.
- ///
- /// Account properties.
- void StartImapConnectionSetup(MailAccount account);
- }
+ ///
+ /// Updates account properties for the welcome imap setup dialog and starts the setup.
+ ///
+ /// Account properties.
+ void StartImapConnectionSetup(MailAccount account);
}
diff --git a/Wino.Core.Domain/Interfaces/IImapSynchronizationStrategyProvider.cs b/Wino.Core.Domain/Interfaces/IImapSynchronizationStrategyProvider.cs
index 6292285f..3fafc48e 100644
--- a/Wino.Core.Domain/Interfaces/IImapSynchronizationStrategyProvider.cs
+++ b/Wino.Core.Domain/Interfaces/IImapSynchronizationStrategyProvider.cs
@@ -1,12 +1,11 @@
using MailKit.Net.Imap;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// Provides a synchronization strategy for synchronizing IMAP folders based on the server capabilities.
+///
+public interface IImapSynchronizationStrategyProvider
{
- ///
- /// Provides a synchronization strategy for synchronizing IMAP folders based on the server capabilities.
- ///
- public interface IImapSynchronizationStrategyProvider
- {
- IImapSynchronizerStrategy GetSynchronizationStrategy(IImapClient client);
- }
+ IImapSynchronizerStrategy GetSynchronizationStrategy(IImapClient client);
}
diff --git a/Wino.Core.Domain/Interfaces/IImapSynchronizer.cs b/Wino.Core.Domain/Interfaces/IImapSynchronizer.cs
index 6d3fca5d..496eeb92 100644
--- a/Wino.Core.Domain/Interfaces/IImapSynchronizer.cs
+++ b/Wino.Core.Domain/Interfaces/IImapSynchronizer.cs
@@ -4,14 +4,13 @@ using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Models.MailItem;
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IImapSynchronizer
- {
- uint InitialMessageDownloadCountPerFolder { get; }
+namespace Wino.Core.Domain.Interfaces;
- Task> CreateNewMailPackagesAsync(ImapMessageCreationPackage message, MailItemFolder assignedFolder, CancellationToken cancellationToken = default);
- Task StartIdleClientAsync();
- Task StopIdleClientAsync();
- }
+public interface IImapSynchronizer
+{
+ uint InitialMessageDownloadCountPerFolder { get; }
+
+ Task> CreateNewMailPackagesAsync(ImapMessageCreationPackage message, MailItemFolder assignedFolder, CancellationToken cancellationToken = default);
+ Task StartIdleClientAsync();
+ Task StopIdleClientAsync();
}
diff --git a/Wino.Core.Domain/Interfaces/IImapSynchronizerStrategy.cs b/Wino.Core.Domain/Interfaces/IImapSynchronizerStrategy.cs
index 0b1f7aff..be6e1218 100644
--- a/Wino.Core.Domain/Interfaces/IImapSynchronizerStrategy.cs
+++ b/Wino.Core.Domain/Interfaces/IImapSynchronizerStrategy.cs
@@ -4,19 +4,18 @@ using System.Threading.Tasks;
using MailKit.Net.Imap;
using Wino.Core.Domain.Entities.Mail;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IImapSynchronizerStrategy
{
- public interface IImapSynchronizerStrategy
- {
- ///
- /// Synchronizes given folder with the ImapClient client from the client pool.
- ///
- /// Client to perform sync with. I love Mira and Jasminka
- /// Folder to synchronize.
- /// Imap synchronizer that downloads messages.
- /// Cancellation token.
- /// List of new downloaded message ids that don't exist locally.
- Task> HandleSynchronizationAsync(IImapClient client, MailItemFolder folder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default);
- }
+ ///
+ /// Synchronizes given folder with the ImapClient client from the client pool.
+ ///
+ /// Client to perform sync with. I love Mira and Jasminka
+ /// Folder to synchronize.
+ /// Imap synchronizer that downloads messages.
+ /// Cancellation token.
+ /// List of new downloaded message ids that don't exist locally.
+ Task> HandleSynchronizationAsync(IImapClient client, MailItemFolder folder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default);
}
diff --git a/Wino.Core.Domain/Interfaces/IImapTestService.cs b/Wino.Core.Domain/Interfaces/IImapTestService.cs
index d79837e6..4ceeef68 100644
--- a/Wino.Core.Domain/Interfaces/IImapTestService.cs
+++ b/Wino.Core.Domain/Interfaces/IImapTestService.cs
@@ -1,10 +1,9 @@
using System.Threading.Tasks;
using Wino.Core.Domain.Entities.Shared;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IImapTestService
{
- public interface IImapTestService
- {
- Task TestImapConnectionAsync(CustomServerInformation serverInformation, bool allowSSLHandShake);
- }
+ Task TestImapConnectionAsync(CustomServerInformation serverInformation, bool allowSSLHandShake);
}
diff --git a/Wino.Core.Domain/Interfaces/IImapThreadingStrategy.cs b/Wino.Core.Domain/Interfaces/IImapThreadingStrategy.cs
index 47883ac4..b613cd70 100644
--- a/Wino.Core.Domain/Interfaces/IImapThreadingStrategy.cs
+++ b/Wino.Core.Domain/Interfaces/IImapThreadingStrategy.cs
@@ -1,4 +1,3 @@
-namespace Wino.Core.Domain.Interfaces
-{
- public interface IImapThreadingStrategy : IThreadingStrategy { }
-}
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IImapThreadingStrategy : IThreadingStrategy { }
diff --git a/Wino.Core.Domain/Interfaces/IInitializeAsync.cs b/Wino.Core.Domain/Interfaces/IInitializeAsync.cs
index 1850a7c0..d12e45dd 100644
--- a/Wino.Core.Domain/Interfaces/IInitializeAsync.cs
+++ b/Wino.Core.Domain/Interfaces/IInitializeAsync.cs
@@ -1,12 +1,11 @@
using System.Threading.Tasks;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+///
+/// An interface that all startup services must implement.
+///
+public interface IInitializeAsync
{
- ///
- /// An interface that all startup services must implement.
- ///
- public interface IInitializeAsync
- {
- Task InitializeAsync();
- }
+ Task InitializeAsync();
}
diff --git a/Wino.Core.Domain/Interfaces/IKeyPressService.cs b/Wino.Core.Domain/Interfaces/IKeyPressService.cs
index 724ad0c4..79fb90c2 100644
--- a/Wino.Core.Domain/Interfaces/IKeyPressService.cs
+++ b/Wino.Core.Domain/Interfaces/IKeyPressService.cs
@@ -1,8 +1,7 @@
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IKeyPressService
{
- public interface IKeyPressService
- {
- bool IsCtrlKeyPressed();
- bool IsShiftKeyPressed();
- }
+ bool IsCtrlKeyPressed();
+ bool IsShiftKeyPressed();
}
diff --git a/Wino.Core.Domain/Interfaces/ILogInitializer.cs b/Wino.Core.Domain/Interfaces/ILogInitializer.cs
index 13accf16..35870d53 100644
--- a/Wino.Core.Domain/Interfaces/ILogInitializer.cs
+++ b/Wino.Core.Domain/Interfaces/ILogInitializer.cs
@@ -1,9 +1,8 @@
-namespace Wino.Core.Domain.Interfaces
-{
- public interface ILogInitializer
- {
- void SetupLogger(string fullLogFilePath);
+namespace Wino.Core.Domain.Interfaces;
- void RefreshLoggingLevel();
- }
+public interface ILogInitializer
+{
+ void SetupLogger(string fullLogFilePath);
+
+ void RefreshLoggingLevel();
}
diff --git a/Wino.Core.Domain/Interfaces/IMailDialogService.cs b/Wino.Core.Domain/Interfaces/IMailDialogService.cs
index 1e122d5c..53050931 100644
--- a/Wino.Core.Domain/Interfaces/IMailDialogService.cs
+++ b/Wino.Core.Domain/Interfaces/IMailDialogService.cs
@@ -7,47 +7,46 @@ using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Folders;
-namespace Wino.Core.Domain.Interfaces
+namespace Wino.Core.Domain.Interfaces;
+
+public interface IMailDialogService : IDialogServiceBase
{
- public interface IMailDialogService : IDialogServiceBase
- {
- Task ShowHardDeleteConfirmationAsync();
- Task HandleSystemFolderConfigurationDialogAsync(Guid accountId, IFolderService folderService);
+ Task ShowHardDeleteConfirmationAsync();
+ Task HandleSystemFolderConfigurationDialogAsync(Guid accountId, IFolderService folderService);
- // Custom dialogs
- Task ShowMoveMailFolderDialogAsync(List availableFolders);
- Task ShowAccountPickerDialogAsync(List availableAccounts);
+ // Custom dialogs
+ Task ShowMoveMailFolderDialogAsync(List availableFolders);
+ Task