diff --git a/Directory.Build.Props b/Directory.Build.Props new file mode 100644 index 00000000..4dc8e2bb --- /dev/null +++ b/Directory.Build.Props @@ -0,0 +1,6 @@ + + + preview + true + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..69a0f320 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,63 @@ + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wino.Authentication/Wino.Authentication.csproj b/Wino.Authentication/Wino.Authentication.csproj index a44ce5dc..6c74f831 100644 --- a/Wino.Authentication/Wino.Authentication.csproj +++ b/Wino.Authentication/Wino.Authentication.csproj @@ -1,26 +1,23 @@  - - netstandard2.0 + net9.0 + win-x86;win-x64;win-arm64 Wino.Authentication Debug;Release - 12 - AnyCPU;x64;x86 + x86;x64;arm64 true true - - - - - - - + + + + + + - - - + + - + \ No newline at end of file diff --git a/Wino.Core.Domain/BasicTypesJsonContext.cs b/Wino.Core.Domain/BasicTypesJsonContext.cs new file mode 100644 index 00000000..b9dba02d --- /dev/null +++ b/Wino.Core.Domain/BasicTypesJsonContext.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Wino.Core.Domain; + +[JsonSerializable(typeof(Dictionary))] +[JsonSerializable(typeof(string))] +[JsonSerializable(typeof(int))] +[JsonSerializable(typeof(List))] +[JsonSerializable(typeof(bool))] +public partial class BasicTypesJsonContext : JsonSerializerContext; diff --git a/Wino.Core.Domain/Interfaces/INativeAppService.cs b/Wino.Core.Domain/Interfaces/INativeAppService.cs index 19eca7da..9b6335d7 100644 --- a/Wino.Core.Domain/Interfaces/INativeAppService.cs +++ b/Wino.Core.Domain/Interfaces/INativeAppService.cs @@ -11,12 +11,6 @@ namespace Wino.Core.Domain.Interfaces Task LaunchFileAsync(string filePath); Task LaunchUriAsync(Uri uri); - /// - /// Finalizes GetAuthorizationResponseUriAsync for current IAuthenticator. - /// - /// - void ContinueAuthorization(Uri authorizationResponseUri); - bool IsAppRunning(); string GetFullAppVersion(); diff --git a/Wino.Core.Domain/Interfaces/IWinoSynchronizerFactory.cs b/Wino.Core.Domain/Interfaces/IWinoSynchronizerFactory.cs deleted file mode 100644 index b14480c9..00000000 --- a/Wino.Core.Domain/Interfaces/IWinoSynchronizerFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using Wino.Core.Domain.Entities; - -namespace Wino.Core.Domain.Interfaces -{ - public interface IWinoSynchronizerFactory : IInitializeAsync - { - IBaseSynchronizer GetAccountSynchronizer(Guid accountId); - IBaseSynchronizer CreateNewSynchronizer(MailAccount account); - } -} diff --git a/Wino.Core.Domain/Models/Accounts/ProviderDetail.cs b/Wino.Core.Domain/Models/Accounts/ProviderDetail.cs index f18c8ba7..c6719694 100644 --- a/Wino.Core.Domain/Models/Accounts/ProviderDetail.cs +++ b/Wino.Core.Domain/Models/Accounts/ProviderDetail.cs @@ -11,7 +11,7 @@ namespace Wino.Core.Domain.Models.Accounts public string Description { get; } - public string ProviderImage => $"ms-appx:///Wino.Core.UWP/Assets/Providers/{Type}.png"; + public string ProviderImage => $"/Wino.Core.UWP/Assets/Providers/{Type}.png"; public bool IsSupported => Type == MailProviderType.Outlook || Type == MailProviderType.Gmail || Type == MailProviderType.IMAP4; diff --git a/Wino.Core.Domain/Models/DomainModelsJsonContext.cs b/Wino.Core.Domain/Models/DomainModelsJsonContext.cs new file mode 100644 index 00000000..39ce4827 --- /dev/null +++ b/Wino.Core.Domain/Models/DomainModelsJsonContext.cs @@ -0,0 +1,11 @@ +using System.Text.Json.Serialization; +using Wino.Core.Domain.Models.AutoDiscovery; +using Wino.Core.Domain.Models.Personalization; +using Wino.Core.Domain.Models.Reader; + +namespace Wino.Core.Domain.Models; + +[JsonSerializable(typeof(AutoDiscoverySettings))] +[JsonSerializable(typeof(CustomThemeMetadata))] +[JsonSerializable(typeof(WebViewMessage))] +public partial class DomainModelsJsonContext: JsonSerializerContext; diff --git a/Wino.Core.Domain/Translations/WinoTranslationDictionary.cs b/Wino.Core.Domain/Translations/WinoTranslationDictionary.cs index fdbbea8c..4aa9b8c8 100644 --- a/Wino.Core.Domain/Translations/WinoTranslationDictionary.cs +++ b/Wino.Core.Domain/Translations/WinoTranslationDictionary.cs @@ -10,12 +10,14 @@ namespace Wino.Core.Domain.Translations // Return the key itself in case of translation is not found. public string GetTranslatedString(string key) => TryGetValue(key, out string keyValue) ? keyValue : key; - public Stream GetLanguageStream(AppLanguage language) + public static Stream GetLanguageStream(AppLanguage language) { var path = GetLanguageFileNameRelativePath(language); var executingAssembly = Assembly.GetExecutingAssembly(); - string languageResourcePath = $"{executingAssembly.ManifestModule.Name.Replace(".dll", ".")}Translations.{path}.resources.json"; + // Use the assembly's name instead of the module name to construct the resource path + string assemblyName = executingAssembly.GetName().Name; + string languageResourcePath = $"{assemblyName}.Translations.{path}.resources.json"; return executingAssembly.GetManifestResourceStream(languageResourcePath); } diff --git a/Wino.Core.Domain/Wino.Core.Domain.csproj b/Wino.Core.Domain/Wino.Core.Domain.csproj index bf3c6728..f34bd83b 100644 --- a/Wino.Core.Domain/Wino.Core.Domain.csproj +++ b/Wino.Core.Domain/Wino.Core.Domain.csproj @@ -1,88 +1,73 @@  - - - netstandard2.0 - true - 12.0 - AnyCPU;x64;x86 - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net9.0 + win-x86;win-x64;win-arm64 + true + x86;x64;arm64 + true + true + - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + \ No newline at end of file diff --git a/Wino.Core.UWP/BasePage.cs b/Wino.Core.UWP/BasePage.cs index a5054556..5857bd09 100644 --- a/Wino.Core.UWP/BasePage.cs +++ b/Wino.Core.UWP/BasePage.cs @@ -10,7 +10,7 @@ using Wino.Messaging.Client.Shell; namespace Wino.Core.UWP { - public class BasePage : Page, IRecipient + public partial class BasePage : Page, IRecipient { public UIElement ShellContent { diff --git a/Wino.Core.UWP/Controls/CustomWrapPanel.cs b/Wino.Core.UWP/Controls/CustomWrapPanel.cs index be53b8c8..af875259 100644 --- a/Wino.Core.UWP/Controls/CustomWrapPanel.cs +++ b/Wino.Core.UWP/Controls/CustomWrapPanel.cs @@ -8,7 +8,7 @@ namespace Wino.Core.UWP.Controls namespace CustomControls { - public class CustomWrapPanel : Panel + public partial class CustomWrapPanel : Panel { protected override Size MeasureOverride(Size availableSize) { diff --git a/Wino.Core.UWP/Controls/EqualGridPanel.cs b/Wino.Core.UWP/Controls/EqualGridPanel.cs index d784bd7e..b2687f95 100644 --- a/Wino.Core.UWP/Controls/EqualGridPanel.cs +++ b/Wino.Core.UWP/Controls/EqualGridPanel.cs @@ -4,7 +4,7 @@ using Windows.UI.Xaml.Controls; namespace Wino.Core.UWP.Controls { - public class EqualGridPanel : Panel + public partial class EqualGridPanel : Panel { public int Rows { diff --git a/Wino.Core.UWP/Controls/WinoAppTitleBar.xaml b/Wino.Core.UWP/Controls/WinoAppTitleBar.xaml index 3903e3b3..4a3f5eab 100644 --- a/Wino.Core.UWP/Controls/WinoAppTitleBar.xaml +++ b/Wino.Core.UWP/Controls/WinoAppTitleBar.xaml @@ -120,14 +120,14 @@ Grid.Column="1" Margin="4,0,0,0" HorizontalAlignment="Left" - ToolTipService.ToolTip="{x:Bind domain:Translator.TitleBarServerDisconnectedButton_Description, Mode=OneWay}" + ToolTipService.ToolTip="{x:Bind domain:Translator.TitleBarServerDisconnectedButton_Description}" Visibility="Collapsed"> @@ -170,7 +170,7 @@ - + @@ -181,7 +181,7 @@ - + diff --git a/Wino.Core.UWP/Controls/WinoFontIcon.cs b/Wino.Core.UWP/Controls/WinoFontIcon.cs index 1103d1b3..4d57da26 100644 --- a/Wino.Core.UWP/Controls/WinoFontIcon.cs +++ b/Wino.Core.UWP/Controls/WinoFontIcon.cs @@ -102,7 +102,7 @@ namespace Wino.Core.UWP.Controls ViewMessageSource, } - public class WinoFontIcon : FontIcon + public partial class WinoFontIcon : FontIcon { public WinoIconGlyph Icon { diff --git a/Wino.Core.UWP/Controls/WinoFontIconSource.cs b/Wino.Core.UWP/Controls/WinoFontIconSource.cs index e8bcaf7a..2b433e79 100644 --- a/Wino.Core.UWP/Controls/WinoFontIconSource.cs +++ b/Wino.Core.UWP/Controls/WinoFontIconSource.cs @@ -3,7 +3,7 @@ using Wino.Core.UWP.Controls; namespace Wino.Controls { - public class WinoFontIconSource : Microsoft.UI.Xaml.Controls.FontIconSource + public partial class WinoFontIconSource : Microsoft.UI.Xaml.Controls.FontIconSource { public WinoIconGlyph Icon { diff --git a/Wino.Core.UWP/Controls/WinoInfoBar.cs b/Wino.Core.UWP/Controls/WinoInfoBar.cs index 70f18869..7eb788fd 100644 --- a/Wino.Core.UWP/Controls/WinoInfoBar.cs +++ b/Wino.Core.UWP/Controls/WinoInfoBar.cs @@ -7,7 +7,7 @@ using Wino.Core.Domain.Enums; namespace Wino.Core.UWP.Controls { - public class WinoInfoBar : InfoBar + public partial class WinoInfoBar : InfoBar { public static readonly DependencyProperty AnimationTypeProperty = DependencyProperty.Register(nameof(AnimationType), typeof(InfoBarAnimationType), typeof(WinoInfoBar), new PropertyMetadata(InfoBarAnimationType.SlideFromRightToLeft)); public static readonly DependencyProperty DismissIntervalProperty = DependencyProperty.Register(nameof(DismissInterval), typeof(int), typeof(WinoInfoBar), new PropertyMetadata(5, new PropertyChangedCallback(OnDismissIntervalChanged))); diff --git a/Wino.Core.UWP/Controls/WinoNavigationViewItem.cs b/Wino.Core.UWP/Controls/WinoNavigationViewItem.cs index b831567c..5a763e08 100644 --- a/Wino.Core.UWP/Controls/WinoNavigationViewItem.cs +++ b/Wino.Core.UWP/Controls/WinoNavigationViewItem.cs @@ -5,7 +5,7 @@ using Windows.UI.Xaml.Hosting; namespace Wino.Core.UWP.Controls { - public class WinoNavigationViewItem : NavigationViewItem + public partial class WinoNavigationViewItem : NavigationViewItem { public bool IsDraggingItemOver { diff --git a/Wino.Core.UWP/Converters/GridLengthConverter.cs b/Wino.Core.UWP/Converters/GridLengthConverter.cs index 14eb8321..9ef553a0 100644 --- a/Wino.Core.UWP/Converters/GridLengthConverter.cs +++ b/Wino.Core.UWP/Converters/GridLengthConverter.cs @@ -1,10 +1,10 @@ using System; -using Windows.UI.Xaml.Data; using Windows.UI.Xaml; +using Windows.UI.Xaml.Data; namespace Wino.Converters { - public class GridLengthConverter : IValueConverter + public partial class GridLengthConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/Wino.Core.UWP/Converters/ReverseBooleanConverter.cs b/Wino.Core.UWP/Converters/ReverseBooleanConverter.cs index d706e0a5..2fdf9c35 100644 --- a/Wino.Core.UWP/Converters/ReverseBooleanConverter.cs +++ b/Wino.Core.UWP/Converters/ReverseBooleanConverter.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml.Data; namespace Wino.Converters { - public class ReverseBooleanConverter : IValueConverter + public partial class ReverseBooleanConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/Wino.Core.UWP/Converters/ReverseBooleanToVisibilityConverter.cs b/Wino.Core.UWP/Converters/ReverseBooleanToVisibilityConverter.cs index 04eaf98d..3102cea4 100644 --- a/Wino.Core.UWP/Converters/ReverseBooleanToVisibilityConverter.cs +++ b/Wino.Core.UWP/Converters/ReverseBooleanToVisibilityConverter.cs @@ -1,14 +1,10 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; namespace Wino.Converters { - public class ReverseBooleanToVisibilityConverter : IValueConverter + public partial class ReverseBooleanToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { diff --git a/Wino.Core.UWP/Dialogs/CustomMessageDialogInformationContainer.cs b/Wino.Core.UWP/Dialogs/CustomMessageDialogInformationContainer.cs index 43fc2b37..ceac338e 100644 --- a/Wino.Core.UWP/Dialogs/CustomMessageDialogInformationContainer.cs +++ b/Wino.Core.UWP/Dialogs/CustomMessageDialogInformationContainer.cs @@ -6,7 +6,7 @@ namespace Wino.Dialogs public partial class CustomMessageDialogInformationContainer : ObservableObject { [ObservableProperty] - private bool isDontAskChecked; + public partial bool IsDontAskChecked { get; set; } public CustomMessageDialogInformationContainer(string title, string description, WinoCustomMessageDialogIcon icon, bool isDontAskAgainEnabled) { diff --git a/Wino.Core.UWP/Extensions/StorageFileExtensions.cs b/Wino.Core.UWP/Extensions/StorageFileExtensions.cs index d61317e1..98b2aae4 100644 --- a/Wino.Core.UWP/Extensions/StorageFileExtensions.cs +++ b/Wino.Core.UWP/Extensions/StorageFileExtensions.cs @@ -1,5 +1,7 @@ -using System.Threading.Tasks; -using Microsoft.Toolkit.Uwp.Helpers; +using System; +using System.IO; +using System.Threading.Tasks; +using Windows.Storage; using Wino.Core.Domain.Models.Common; namespace Wino.Core.UWP.Extensions @@ -8,9 +10,22 @@ namespace Wino.Core.UWP.Extensions { public static async Task ToSharedFileAsync(this Windows.Storage.StorageFile storageFile) { - var content = await storageFile.ReadBytesAsync(); + var content = await storageFile.ToByteArrayAsync(); return new SharedFile(storageFile.Path, content); } + + public static async Task ToByteArrayAsync(this StorageFile file) + { + if (file == null) + throw new ArgumentNullException(nameof(file)); + + using (var stream = await file.OpenReadAsync()) + using (var memoryStream = new MemoryStream()) + { + await stream.AsStreamForRead().CopyToAsync(memoryStream); + return memoryStream.ToArray(); + } + } } } diff --git a/Wino.Core.UWP/Extensions/UtilExtensions.cs b/Wino.Core.UWP/Extensions/UtilExtensions.cs index 6a1185c0..ff64530e 100644 --- a/Wino.Core.UWP/Extensions/UtilExtensions.cs +++ b/Wino.Core.UWP/Extensions/UtilExtensions.cs @@ -103,6 +103,6 @@ namespace Wino.Extensions } - public static IEnumerable GetValues() => Enum.GetValues(typeof(T)).Cast(); + public static T[] GetValues() where T : struct, Enum => Enum.GetValues(); } } diff --git a/Wino.Core.UWP/Extensions/WebViewExtensions.cs b/Wino.Core.UWP/Extensions/WebViewExtensions.cs new file mode 100644 index 00000000..c411351e --- /dev/null +++ b/Wino.Core.UWP/Extensions/WebViewExtensions.cs @@ -0,0 +1,32 @@ +using System; +using System.Threading.Tasks; + +namespace Wino.Core.UWP.Extensions; + +public static class WebViewExtensions +{ + /// + /// Executes a script function in the WebView2 control. + /// + /// Weird parameter that needed in mailRendering page. TODO: should be reconsidered. + /// Parameters should be serialized to json + public static async Task ExecuteScriptFunctionAsync(this Microsoft.UI.Xaml.Controls.WebView2 Chromium, string functionName, bool isChromiumDisposed = false, params string[] parameters) + { + string script = functionName + "(" + string.Join(", ", parameters) + ");"; + + return isChromiumDisposed ? string.Empty : await Chromium.ExecuteScriptAsync(script); + } + + public static async Task ExecuteScriptFunctionSafeAsync(this Microsoft.UI.Xaml.Controls.WebView2 Chromium, string functionName, params string[] parameters) + { + if (Chromium == null) return string.Empty; + + try + { + return await Chromium.ExecuteScriptFunctionAsync(functionName, parameters: parameters); + } + catch { } + + return string.Empty; + } +} diff --git a/Wino.Core.UWP/Helpers/XamlHelpers.cs b/Wino.Core.UWP/Helpers/XamlHelpers.cs index a93489b0..8e28631a 100644 --- a/Wino.Core.UWP/Helpers/XamlHelpers.cs +++ b/Wino.Core.UWP/Helpers/XamlHelpers.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Linq; -using Microsoft.Toolkit.Uwp.Helpers; +using CommunityToolkit.WinUI.Helpers; using Microsoft.UI.Xaml.Controls; using Windows.UI; using Windows.UI.Text; diff --git a/Wino.Core.UWP/Properties/AssemblyInfo.cs b/Wino.Core.UWP/Properties/AssemblyInfo.cs deleted file mode 100644 index 8d1893a5..00000000 --- a/Wino.Core.UWP/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Wino.Core.UWP")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wino.Core.UWP")] -[assembly: AssemblyCopyright("Copyright © 2023")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Wino.Core.UWP/Properties/Wino.Core.UWP.rd.xml b/Wino.Core.UWP/Properties/Wino.Core.UWP.rd.xml deleted file mode 100644 index ba802981..00000000 --- a/Wino.Core.UWP/Properties/Wino.Core.UWP.rd.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - diff --git a/Wino.Core.UWP/Selectors/AppThemePreviewTemplateSelector.cs b/Wino.Core.UWP/Selectors/AppThemePreviewTemplateSelector.cs index d1091e85..5df00d6f 100644 --- a/Wino.Core.UWP/Selectors/AppThemePreviewTemplateSelector.cs +++ b/Wino.Core.UWP/Selectors/AppThemePreviewTemplateSelector.cs @@ -4,7 +4,7 @@ using Wino.Core.UWP.Models.Personalization; namespace Wino.Core.UWP.Selectors { - public class AppThemePreviewTemplateSelector : DataTemplateSelector + public partial class AppThemePreviewTemplateSelector : DataTemplateSelector { public DataTemplate SystemThemeTemplate { get; set; } public DataTemplate PreDefinedThemeTemplate { get; set; } diff --git a/Wino.Core.UWP/Selectors/CustomWinoMessageDialogIconSelector.cs b/Wino.Core.UWP/Selectors/CustomWinoMessageDialogIconSelector.cs index 6f339354..d1229556 100644 --- a/Wino.Core.UWP/Selectors/CustomWinoMessageDialogIconSelector.cs +++ b/Wino.Core.UWP/Selectors/CustomWinoMessageDialogIconSelector.cs @@ -5,7 +5,7 @@ using Wino.Core.Domain.Enums; namespace Wino.Core.UWP.Selectors { - public class CustomWinoMessageDialogIconSelector : DataTemplateSelector + public partial class CustomWinoMessageDialogIconSelector : DataTemplateSelector { public DataTemplate InfoIconTemplate { get; set; } public DataTemplate WarningIconTemplate { get; set; } diff --git a/Wino.Core.UWP/Selectors/FileAttachmentTypeSelector.cs b/Wino.Core.UWP/Selectors/FileAttachmentTypeSelector.cs index e83507a5..075dc9d3 100644 --- a/Wino.Core.UWP/Selectors/FileAttachmentTypeSelector.cs +++ b/Wino.Core.UWP/Selectors/FileAttachmentTypeSelector.cs @@ -4,7 +4,7 @@ using Wino.Core.Domain.Enums; namespace Wino.Core.UWP.Selectors { - public class FileAttachmentTypeSelector : DataTemplateSelector + public partial class FileAttachmentTypeSelector : DataTemplateSelector { public DataTemplate None { get; set; } public DataTemplate Executable { get; set; } diff --git a/Wino.Core.UWP/Selectors/NavigationMenuTemplateSelector.cs b/Wino.Core.UWP/Selectors/NavigationMenuTemplateSelector.cs index 807c6a02..64faf8e1 100644 --- a/Wino.Core.UWP/Selectors/NavigationMenuTemplateSelector.cs +++ b/Wino.Core.UWP/Selectors/NavigationMenuTemplateSelector.cs @@ -4,7 +4,7 @@ using Wino.Core.Domain.MenuItems; namespace Wino.Core.UWP.Selectors { - public class NavigationMenuTemplateSelector : DataTemplateSelector + public partial class NavigationMenuTemplateSelector : DataTemplateSelector { public DataTemplate MenuItemTemplate { get; set; } public DataTemplate AccountManagementTemplate { get; set; } diff --git a/Wino.Core.UWP/Services/ConfigurationService.cs b/Wino.Core.UWP/Services/ConfigurationService.cs index 7c905742..1cff9923 100644 --- a/Wino.Core.UWP/Services/ConfigurationService.cs +++ b/Wino.Core.UWP/Services/ConfigurationService.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel; +using System.Globalization; using Windows.Foundation.Collections; using Windows.Storage; using Wino.Core.Domain.Interfaces; @@ -20,32 +21,32 @@ namespace Wino.Core.UWP.Services public void SetRoaming(string key, object value) => SetInternal(key, value, ApplicationData.Current.RoamingSettings.Values); - private T GetInternal(string key, IPropertySet collection, T defaultValue = default) + private static T GetInternal(string key, IPropertySet collection, T defaultValue = default) { - if (collection.ContainsKey(key)) + if (collection.TryGetValue(key, out object value)) { - var value = collection[key]?.ToString(); + var stringValue = value?.ToString(); if (typeof(T).IsEnum) - return (T)Enum.Parse(typeof(T), value); + return (T)Enum.Parse(typeof(T), stringValue); - if (typeof(T) == typeof(Guid?) && Guid.TryParse(value, out Guid guidResult)) + if ((typeof(T) == typeof(Guid?) || typeof(T) == typeof(Guid)) && Guid.TryParse(stringValue, out Guid guidResult)) { - return (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(value); + return (T)(object)guidResult; } if (typeof(T) == typeof(TimeSpan)) { - return (T)(object)TimeSpan.Parse(value); + return (T)(object)TimeSpan.Parse(stringValue); } - return (T)Convert.ChangeType(value, typeof(T)); + return (T)Convert.ChangeType(stringValue, typeof(T)); } return defaultValue; } - private void SetInternal(string key, object value, IPropertySet collection) + private static void SetInternal(string key, object value, IPropertySet collection) => collection[key] = value?.ToString(); } } diff --git a/Wino.Core.UWP/Services/DialogServiceBase.cs b/Wino.Core.UWP/Services/DialogServiceBase.cs index bec6852d..214ce1fd 100644 --- a/Wino.Core.UWP/Services/DialogServiceBase.cs +++ b/Wino.Core.UWP/Services/DialogServiceBase.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Messaging; -using Microsoft.Toolkit.Uwp.Helpers; using Serilog; using Windows.Storage; using Windows.Storage.AccessCache; @@ -146,7 +145,7 @@ namespace Wino.Core.UWP.Services if (file == null) return []; - return await file.ReadBytesAsync(); + return await file.ToByteArrayAsync(); } public Task ShowMessageAsync(string message, string title, WinoCustomMessageDialogIcon icon = WinoCustomMessageDialogIcon.Information) diff --git a/Wino.Core.UWP/Services/NativeAppService.cs b/Wino.Core.UWP/Services/NativeAppService.cs index e5abdb6b..97346729 100644 --- a/Wino.Core.UWP/Services/NativeAppService.cs +++ b/Wino.Core.UWP/Services/NativeAppService.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Windows.ApplicationModel; using Windows.Foundation.Metadata; -using Windows.Security.Authentication.Web; using Windows.Storage; using Windows.System; using Windows.UI.Shell; @@ -21,7 +20,6 @@ namespace Wino.Services { private string _mimeMessagesFolder; private string _editorBundlePath; - private TaskCompletionSource authorizationCompletedTaskSource; public Func GetCoreWindowHwnd { get; set; } @@ -107,13 +105,5 @@ namespace Wino.Services await taskbarManager.RequestPinCurrentAppAsync(); } - - public void ContinueAuthorization(Uri authorizationResponseUri) - { - if (authorizationCompletedTaskSource != null) - { - authorizationCompletedTaskSource.TrySetResult(authorizationResponseUri); - } - } } } diff --git a/Wino.Core.UWP/Services/ThemeService.cs b/Wino.Core.UWP/Services/ThemeService.cs index 8f1fe9c6..21d21e7c 100644 --- a/Wino.Core.UWP/Services/ThemeService.cs +++ b/Wino.Core.UWP/Services/ThemeService.cs @@ -7,7 +7,7 @@ using System.Runtime.InteropServices.WindowsRuntime; using System.Text.Json; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Messaging; -using Microsoft.Toolkit.Uwp.Helpers; +using CommunityToolkit.WinUI.Helpers; using Windows.Storage; using Windows.UI; using Windows.UI.ViewManagement; @@ -19,6 +19,7 @@ using Wino.Core.Domain; using Wino.Core.Domain.Enums; using Wino.Core.Domain.Exceptions; using Wino.Core.Domain.Interfaces; +using Wino.Core.Domain.Models; using Wino.Core.Domain.Models.Personalization; using Wino.Core.UWP.Extensions; using Wino.Core.UWP.Models.Personalization; @@ -168,9 +169,7 @@ namespace Wino.Services AccentColor = _configurationService.Get(AccentColorKey, string.Empty); // Set the current theme id. Default to Mica. - var applicationThemeGuid = _configurationService.Get(CurrentApplicationThemeKey, _micaThemeId); - - currentApplicationThemeId = Guid.Parse(applicationThemeGuid); + currentApplicationThemeId = _configurationService.Get(CurrentApplicationThemeKey, Guid.Parse(_micaThemeId)); await ApplyCustomThemeAsync(true); @@ -235,7 +234,7 @@ namespace Wino.Services // Change accent color if specified. if (!string.IsNullOrEmpty(hex)) { - var color = Microsoft.Toolkit.Uwp.Helpers.ColorHelper.ToColor(hex); + var color = CommunityToolkit.WinUI.Helpers.ColorHelper.ToColor(hex); var brush = new SolidColorBrush(color); if (_applicationResourceManager.ContainsResourceKey("SystemAccentColor")) @@ -412,7 +411,7 @@ namespace Wino.Services { byte[] bytes = new byte[readerStream.Length]; - await readerStream.ReadAsync(bytes, 0, bytes.Length); + await readerStream.ReadExactlyAsync(bytes); var buffer = bytes.AsBuffer(); @@ -422,7 +421,7 @@ namespace Wino.Services // Save metadata. var metadataFile = await themeFolder.CreateFileAsync($"{newTheme.Id}.json", CreationCollisionOption.ReplaceExisting); - var serialized = JsonSerializer.Serialize(newTheme); + var serialized = JsonSerializer.Serialize(newTheme, DomainModelsJsonContext.Default.CustomThemeMetadata); await FileIO.WriteTextAsync(metadataFile, serialized); return newTheme; @@ -454,7 +453,7 @@ namespace Wino.Services { var fileContent = await FileIO.ReadTextAsync(file); - return JsonSerializer.Deserialize(fileContent); + return JsonSerializer.Deserialize(fileContent, DomainModelsJsonContext.Default.CustomThemeMetadata); } public string GetSystemAccentColorHex() diff --git a/Wino.Core.UWP/Services/WinoServerConnectionManager.cs b/Wino.Core.UWP/Services/WinoServerConnectionManager.cs index 80d279d7..206a1dc6 100644 --- a/Wino.Core.UWP/Services/WinoServerConnectionManager.cs +++ b/Wino.Core.UWP/Services/WinoServerConnectionManager.cs @@ -200,61 +200,61 @@ namespace Wino.Core.UWP.Services switch (typeName) { case nameof(MailAddedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.MailAddedMessage)); break; case nameof(MailDownloadedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.MailDownloadedMessage)); break; case nameof(MailRemovedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.MailRemovedMessage)); break; case nameof(MailUpdatedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.MailUpdatedMessage)); break; case nameof(AccountCreatedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountCreatedMessage)); break; case nameof(AccountRemovedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountRemovedMessage)); break; case nameof(AccountUpdatedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountUpdatedMessage)); break; case nameof(DraftCreated): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.DraftCreated)); break; case nameof(DraftFailed): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.DraftFailed)); break; case nameof(DraftMapped): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.DraftMapped)); break; case nameof(FolderRenamed): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.FolderRenamed)); break; case nameof(FolderSynchronizationEnabled): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.FolderSynchronizationEnabled)); break; case nameof(MergedInboxRenamed): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.MergedInboxRenamed)); break; case nameof(AccountSynchronizationCompleted): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountSynchronizationCompleted)); break; case nameof(RefreshUnreadCountsMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.RefreshUnreadCountsMessage)); break; case nameof(AccountSynchronizerStateChanged): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountSynchronizerStateChanged)); break; case nameof(AccountSynchronizationProgressUpdatedMessage): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountSynchronizationProgressUpdatedMessage)); break; case nameof(AccountFolderConfigurationUpdated): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.AccountFolderConfigurationUpdated)); break; case nameof(CopyAuthURLRequested): - WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson)); + WeakReferenceMessenger.Default.Send(JsonSerializer.Deserialize(messageJson, CommunicationMessagesContext.Default.CopyAuthURLRequested)); break; default: throw new Exception("Invalid data type name passed to client."); diff --git a/Wino.Core.UWP/Views/Abstract/SettingsPageBase.cs b/Wino.Core.UWP/Views/Abstract/SettingsPageBase.cs index 076e339d..59961ab2 100644 --- a/Wino.Core.UWP/Views/Abstract/SettingsPageBase.cs +++ b/Wino.Core.UWP/Views/Abstract/SettingsPageBase.cs @@ -4,7 +4,7 @@ using Wino.Core.ViewModels; namespace Wino.Views.Abstract { - public class SettingsPageBase : BasePage where T : CoreBaseViewModel + public partial class SettingsPageBase : BasePage where T : CoreBaseViewModel { public string Title { diff --git a/Wino.Core.UWP/Views/SettingOptionsPage.xaml b/Wino.Core.UWP/Views/SettingOptionsPage.xaml index 5f6c9815..c6e4acc9 100644 --- a/Wino.Core.UWP/Views/SettingOptionsPage.xaml +++ b/Wino.Core.UWP/Views/SettingOptionsPage.xaml @@ -11,7 +11,7 @@ xmlns:settings="using:Wino.Core.Domain.Models.Settings" xmlns:translations="using:Wino.Core.Domain.Models.Translations" x:Name="root" - Title="{x:Bind domain:Translator.SettingsOptions_Title, Mode=OneWay}" + Title="{x:Bind domain:Translator.SettingsOptions_Title}" mc:Ignorable="d"> diff --git a/Wino.Core.UWP/Wino.Core.UWP.csproj b/Wino.Core.UWP/Wino.Core.UWP.csproj index 68e93778..3165686d 100644 --- a/Wino.Core.UWP/Wino.Core.UWP.csproj +++ b/Wino.Core.UWP/Wino.Core.UWP.csproj @@ -1,432 +1,107 @@ - - - - - Debug - AnyCPU - {395F19BA-1E42-495C-9DB5-1A6F537FCCB8} - Library - Properties - Wino.Core.UWP - Wino.Core.UWP - en-US - UAP - 10.0.22621.0 - 10.0.17763.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - x86 - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - false - prompt - - - x86 - bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - false - prompt - - - ARM64 - true - bin\ARM64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - false - prompt - - - ARM64 - bin\ARM64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - false - prompt - - - x64 - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - false - prompt - - - x64 - bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - false - prompt - - - PackageReference - 12.0 - - - - - - - - - WinoAppTitleBar.xaml - - - - - - - - - - - NewAccountDialog.xaml - - - - - - - - AccountCreationDialog.xaml - - - AccountEditDialog.xaml - - - AccountPickerDialog.xaml - - - - - CustomThemeBuilderDialog.xaml - - - TextInputDialog.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CoreGeneric.xaml - - - CustomMessageDialogStyles.xaml - - - DataTemplates.xaml - - - - - - - ManageAccountsPage.xaml - - - SettingOptionsPage.xaml - - - SettingsPage.xaml - - - - - - - 8.3.2 - - - 8.3.2 - - - 8.3.2 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - - 8.1.240916 - - - 5.0.6 - - - 4.66.2 - - - 6.2.14 - - - 7.1.3 - - - 2.8.6 - - - 1.28.0 - - - - - {cf3312e5-5da0-4867-9945-49ea7598af1f} - Wino.Core.Domain - - - {53723ae8-7e7e-4d54-adab-0a6033255cc8} - Wino.Core.ViewModels - - - {e6b1632a-8901-41e8-9ddf-6793c7698b0b} - Wino.Core - - - {0c307d7e-256f-448c-8265-5622a812fbcc} - Wino.Messaging - - - {4000a374-59fe-4400-acf6-d40473becd73} - Wino.Services - - - - - Windows Desktop Extensions for the UWP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - 14.0 - - - - \ No newline at end of file + + + net9.0-windows10.0.26100.0 + 10.0.17763.0 + x86;x64;arm64 + win-x86;win-x64;win-arm64 + disable + true + en-US + true + true + 10.0.18362.0 + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wino.Core.ViewModels/AccountManagementPageViewModelBase.cs b/Wino.Core.ViewModels/AccountManagementPageViewModelBase.cs index 1fa9dc49..8db194a1 100644 --- a/Wino.Core.ViewModels/AccountManagementPageViewModelBase.cs +++ b/Wino.Core.ViewModels/AccountManagementPageViewModelBase.cs @@ -11,12 +11,11 @@ using Wino.Core.Domain.Interfaces; using Wino.Core.Domain.Models.Navigation; using Wino.Core.Domain.Models.Store; using Wino.Mail.ViewModels.Data; -using Wino.Messaging.Client.Authorization; using Wino.Messaging.Client.Navigation; namespace Wino.Core.ViewModels { - public abstract partial class AccountManagementPageViewModelBase : CoreBaseViewModel, IRecipient + public abstract partial class AccountManagementPageViewModelBase : CoreBaseViewModel { public ObservableCollection Accounts { get; set; } = []; @@ -94,12 +93,6 @@ namespace Wino.Core.ViewModels } } - public async void Receive(ProtocolAuthorizationCallbackReceived message) - { - // Authorization must be completed in the server. - await WinoServerConnectionManager.GetResponseAsync(message); - } - public async Task ManageStorePurchasesAsync() { await ExecuteUIThread(async () => diff --git a/Wino.Core.ViewModels/Wino.Core.ViewModels.csproj b/Wino.Core.ViewModels/Wino.Core.ViewModels.csproj index d53fa682..33fdcc6a 100644 --- a/Wino.Core.ViewModels/Wino.Core.ViewModels.csproj +++ b/Wino.Core.ViewModels/Wino.Core.ViewModels.csproj @@ -1,26 +1,19 @@  - - netstandard2.0 - 12 - AnyCPU;x64;x86 + net9.0 + x86;x64;arm64 + win-x86;win-x64;win-arm64 true true - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + - - + \ No newline at end of file diff --git a/Wino.Core/Services/AutoDiscoveryService.cs b/Wino.Core/Services/AutoDiscoveryService.cs index dc4ee10f..d9e0f4c8 100644 --- a/Wino.Core/Services/AutoDiscoveryService.cs +++ b/Wino.Core/Services/AutoDiscoveryService.cs @@ -4,6 +4,7 @@ using System.Text.Json; using System.Threading.Tasks; using Serilog; using Wino.Core.Domain.Interfaces; +using Wino.Core.Domain.Models; using Wino.Core.Domain.Models.AutoDiscovery; namespace Wino.Core.Services @@ -22,7 +23,7 @@ namespace Wino.Core.Services public Task GetAutoDiscoverySettings(AutoDiscoveryMinimalSettings autoDiscoveryMinimalSettings) => GetSettingsFromFiretrustAsync(autoDiscoveryMinimalSettings.Email); - private async Task GetSettingsFromFiretrustAsync(string mailAddress) + private static async Task GetSettingsFromFiretrustAsync(string mailAddress) { using var client = new HttpClient(); var response = await client.GetAsync($"{FiretrustURL}{mailAddress}"); @@ -37,13 +38,13 @@ namespace Wino.Core.Services } } - private async Task DeserializeFiretrustResponse(HttpResponseMessage response) + private static async Task DeserializeFiretrustResponse(HttpResponseMessage response) { try { var content = await response.Content.ReadAsStringAsync(); - return JsonSerializer.Deserialize(content); + return JsonSerializer.Deserialize(content, DomainModelsJsonContext.Default.AutoDiscoverySettings); } catch (Exception ex) { diff --git a/Wino.Core/Synchronizers/OutlookSynchronizer.cs b/Wino.Core/Synchronizers/OutlookSynchronizer.cs index e386b358..555559f8 100644 --- a/Wino.Core/Synchronizers/OutlookSynchronizer.cs +++ b/Wino.Core/Synchronizers/OutlookSynchronizer.cs @@ -7,6 +7,7 @@ using System.Net; using System.Text; using System.Text.Json; using System.Text.Json.Nodes; +using System.Text.Json.Serialization; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; @@ -39,6 +40,10 @@ using Wino.Core.Requests.Mail; namespace Wino.Core.Synchronizers.Mail { + [JsonSerializable(typeof(Microsoft.Graph.Me.Messages.Item.Move.MovePostRequestBody))] + [JsonSerializable(typeof(OutlookFileAttachment))] + public partial class OutlookSynchronizerJsonContext: JsonSerializerContext; + public class OutlookSynchronizer : WinoSynchronizer { public override uint BatchModificationSize => 20; @@ -98,9 +103,6 @@ namespace Wino.Core.Synchronizers.Mail _graphClient = new GraphServiceClient(httpClient, new BaseBearerTokenAuthenticationProvider(tokenProvider)); _outlookChangeProcessor = outlookChangeProcessor; - - // Specify to use TLS 1.2 as default connection - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; } #region MS Graph Handlers @@ -558,11 +560,11 @@ namespace Wino.Core.Synchronizers.Mail /// Post request information. /// Content object to serialize. /// Updated post request information. - private RequestInformation PreparePostRequestInformation(RequestInformation requestInformation, object content = null) + private RequestInformation PreparePostRequestInformation(RequestInformation requestInformation, Microsoft.Graph.Me.Messages.Item.Move.MovePostRequestBody content = null) { requestInformation.Headers.Clear(); - string contentJson = content == null ? "{}" : JsonSerializer.Serialize(content); + string contentJson = content == null ? "{}" : JsonSerializer.Serialize(content, OutlookSynchronizerJsonContext.Default.MovePostRequestBody); requestInformation.Content = new MemoryStream(Encoding.UTF8.GetBytes(contentJson)); requestInformation.HttpMethod = Method.POST; @@ -584,7 +586,7 @@ namespace Wino.Core.Synchronizers.Mail DestinationId = item.ToFolder.RemoteFolderId }; - return PreparePostRequestInformation(_graphClient.Me.Messages[item.Item.Id.ToString()].Move.ToPostRequestInformation(requestBody), + return PreparePostRequestInformation(_graphClient.Me.Messages[item.Item.Id].Move.ToPostRequestInformation(requestBody), requestBody); }); } @@ -598,7 +600,7 @@ namespace Wino.Core.Synchronizers.Mail Flag = new FollowupFlag() { FlagStatus = item.IsFlagged ? FollowupFlagStatus.Flagged : FollowupFlagStatus.NotFlagged } }; - return _graphClient.Me.Messages[item.Item.Id.ToString()].ToPatchRequestInformation(message); + return _graphClient.Me.Messages[item.Item.Id].ToPatchRequestInformation(message); }); } @@ -759,11 +761,11 @@ namespace Wino.Core.Synchronizers.Mail allAttachments.Add(attachment); } - RequestInformation PrepareUploadAttachmentRequest(RequestInformation requestInformation, OutlookFileAttachment outlookFileAttachment) + static RequestInformation PrepareUploadAttachmentRequest(RequestInformation requestInformation, OutlookFileAttachment outlookFileAttachment) { requestInformation.Headers.Clear(); - string contentJson = JsonSerializer.Serialize(outlookFileAttachment); + string contentJson = JsonSerializer.Serialize(outlookFileAttachment, OutlookSynchronizerJsonContext.Default.OutlookFileAttachment); requestInformation.Content = new MemoryStream(Encoding.UTF8.GetBytes(contentJson)); requestInformation.HttpMethod = Method.POST; @@ -1056,7 +1058,7 @@ namespace Wino.Core.Synchronizers.Mail await _handleItemRetrievalSemaphore.WaitAsync(); await _outlookChangeProcessor.ManageCalendarEventAsync(item, calendar, Account).ConfigureAwait(false); } - catch (Exception ex) + catch (Exception) { // _logger.Error(ex, "Error occurred while handling item {Id} for calendar {Name}", item.Id, calendar.Name); } diff --git a/Wino.Core/Wino.Core.csproj b/Wino.Core/Wino.Core.csproj index 529f4a39..1d02985f 100644 --- a/Wino.Core/Wino.Core.csproj +++ b/Wino.Core/Wino.Core.csproj @@ -1,55 +1,43 @@  - - - netstandard2.0 - Wino.Core - Debug;Release - 12 - AnyCPU;x64;x86 - true - true - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - - + + net9.0 + win-x86;win-x64;win-arm64 + Wino.Core + Debug;Release + x86;x64;arm64 + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Wino.Core/WinoSynchronizerFactory.cs b/Wino.Core/WinoSynchronizerFactory.cs deleted file mode 100644 index 89c34409..00000000 --- a/Wino.Core/WinoSynchronizerFactory.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Wino.Core.Authenticators; -using Wino.Core.Domain.Entities; -using Wino.Core.Domain.Interfaces; -using Wino.Core.Integration.Processors; -using Wino.Core.Services; -using Wino.Core.Synchronizers; - -namespace Wino.Core -{ - /// - /// Factory that keeps track of all integrator with associated mail accounts. - /// Synchronizer per-account makes sense because re-generating synchronizers are not ideal. - /// Users might interact with multiple accounts in 1 app session. - /// - public class WinoSynchronizerFactory : IWinoSynchronizerFactory - { - private readonly List synchronizerCache = new List(); - - private bool isInitialized = false; - private readonly INativeAppService _nativeAppService; - private readonly ITokenService _tokenService; - private readonly IFolderService _folderService; - private readonly IAccountService _accountService; - private readonly IContactService _contactService; - - private readonly INotificationBuilder _notificationBuilder; - private readonly ISignatureService _signatureService; - private readonly IDatabaseService _databaseService; - private readonly IMimeFileService _mimeFileService; - private readonly IOutlookChangeProcessor _outlookChangeProcessor; - private readonly IGmailChangeProcessor _gmailChangeProcessor; - private readonly IImapChangeProcessor _imapChangeProcessor; - - public WinoSynchronizerFactory(INativeAppService nativeAppService, - ITokenService tokenService, - IFolderService folderService, - IAccountService accountService, - IContactService contactService, - INotificationBuilder notificationBuilder, - ISignatureService signatureService, - IDatabaseService databaseService, - IMimeFileService mimeFileService, - IOutlookChangeProcessor outlookChangeProcessor, - IGmailChangeProcessor gmailChangeProcessor, - IImapChangeProcessor imapChangeProcessor) - { - _contactService = contactService; - _notificationBuilder = notificationBuilder; - _nativeAppService = nativeAppService; - _tokenService = tokenService; - _folderService = folderService; - _accountService = accountService; - _signatureService = signatureService; - _databaseService = databaseService; - _mimeFileService = mimeFileService; - _outlookChangeProcessor = outlookChangeProcessor; - _gmailChangeProcessor = gmailChangeProcessor; - _imapChangeProcessor = imapChangeProcessor; - } - - public IBaseSynchronizer GetAccountSynchronizer(Guid accountId) - => synchronizerCache.Find(a => a.Account.Id == accountId); - - private IBaseSynchronizer CreateIntegratorWithDefaultProcessor(MailAccount mailAccount) - { - var providerType = mailAccount.ProviderType; - - switch (providerType) - { - case Domain.Enums.MailProviderType.Outlook: - var outlookAuthenticator = new OutlookAuthenticator(_tokenService, _nativeAppService); - return new OutlookSynchronizer(mailAccount, outlookAuthenticator, _outlookChangeProcessor); - case Domain.Enums.MailProviderType.Gmail: - var gmailAuthenticator = new GmailAuthenticator(_tokenService, _nativeAppService); - return new GmailSynchronizer(mailAccount, gmailAuthenticator, _gmailChangeProcessor); - case Domain.Enums.MailProviderType.Office365: - break; - case Domain.Enums.MailProviderType.Yahoo: - break; - case Domain.Enums.MailProviderType.IMAP4: - return new ImapSynchronizer(mailAccount, _imapChangeProcessor); - default: - break; - } - - return null; - } - - public void DeleteSynchronizer(MailAccount account) - { - var synchronizer = GetAccountSynchronizer(account.Id); - - if (synchronizer == null) return; - - synchronizerCache.Remove(synchronizer); - } - - public async Task InitializeAsync() - { - if (isInitialized) return; - - var accounts = await _accountService.GetAccountsAsync(); - - foreach (var account in accounts) - { - CreateNewSynchronizer(account); - } - - isInitialized = true; - } - - public IBaseSynchronizer CreateNewSynchronizer(MailAccount account) - { - var synchronizer = CreateIntegratorWithDefaultProcessor(account); - - synchronizerCache.Add(synchronizer); - - return synchronizer; - } - } -} diff --git a/Wino.Mail.ViewModels/ComposePageViewModel.cs b/Wino.Mail.ViewModels/ComposePageViewModel.cs index c88ca96a..3a22f162 100644 --- a/Wino.Mail.ViewModels/ComposePageViewModel.cs +++ b/Wino.Mail.ViewModels/ComposePageViewModel.cs @@ -142,7 +142,7 @@ namespace Wino.Mail.ViewModels { await NativeAppService.LaunchFileAsync(attachmentViewModel.FilePath); } - catch (Exception ex) + catch { _dialogService.InfoBarMessage(Translator.Info_FailedToOpenFileTitle, Translator.Info_FailedToOpenFileMessage, InfoBarMessageType.Error); } @@ -159,7 +159,7 @@ namespace Wino.Mail.ViewModels { await _fileService.CopyFileAsync(attachmentViewModel.FilePath, pickedFilePath); } - catch (Exception ex) + catch { _dialogService.InfoBarMessage(Translator.Info_FailedToOpenFileTitle, Translator.Info_FailedToOpenFileMessage, InfoBarMessageType.Error); } diff --git a/Wino.Mail.ViewModels/MessageListPageViewModel.cs b/Wino.Mail.ViewModels/MessageListPageViewModel.cs index b57fa513..47e2282c 100644 --- a/Wino.Mail.ViewModels/MessageListPageViewModel.cs +++ b/Wino.Mail.ViewModels/MessageListPageViewModel.cs @@ -21,7 +21,7 @@ namespace Wino.Mail.ViewModels { if (value >= 0) { - PreferencesService.MarkAsPreference = (MailMarkAsOption)Enum.GetValues(typeof(MailMarkAsOption)).GetValue(value); + PreferencesService.MarkAsPreference = (MailMarkAsOption)Enum.GetValues().GetValue(value); } } } @@ -101,7 +101,7 @@ namespace Wino.Mail.ViewModels centerHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.CenterHoverAction); rightHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.RightHoverAction); - SelectedMarkAsOptionIndex = Array.IndexOf(Enum.GetValues(typeof(MailMarkAsOption)), PreferencesService.MarkAsPreference); + SelectedMarkAsOptionIndex = Array.IndexOf(Enum.GetValues(), PreferencesService.MarkAsPreference); } } } diff --git a/Wino.Mail.ViewModels/Wino.Mail.ViewModels.csproj b/Wino.Mail.ViewModels/Wino.Mail.ViewModels.csproj index b84ad270..b44f763c 100644 --- a/Wino.Mail.ViewModels/Wino.Mail.ViewModels.csproj +++ b/Wino.Mail.ViewModels/Wino.Mail.ViewModels.csproj @@ -1,31 +1,22 @@  - - - netstandard2.0 - 12 - AnyCPU;x64;x86 - - true - true - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - + + net9.0 + x86;x64;arm64 + win-x86;win-x64;win-arm64 + true + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Wino.Mail/Activation/FileActivationHandler.cs b/Wino.Mail/Activation/FileActivationHandler.cs index aa6bec91..a9fbab14 100644 --- a/Wino.Mail/Activation/FileActivationHandler.cs +++ b/Wino.Mail/Activation/FileActivationHandler.cs @@ -2,7 +2,6 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.Toolkit.Uwp.Helpers; using Windows.ApplicationModel.Activation; using Windows.Storage; using Windows.UI.Xaml; @@ -10,6 +9,7 @@ using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media.Animation; using Wino.Core.Domain.Enums; using Wino.Core.Domain.Interfaces; +using Wino.Core.UWP.Extensions; using Wino.Views; namespace Wino.Activation @@ -44,7 +44,7 @@ namespace Wino.Activation if (string.Equals(fileExtension, ".eml", StringComparison.OrdinalIgnoreCase)) { - var fileBytes = await file.ReadBytesAsync(); + var fileBytes = await file.ToByteArrayAsync(); var directoryName = Path.GetDirectoryName(file.Path); var messageInformation = await _mimeFileService.GetMimeMessageInformationAsync(fileBytes, directoryName).ConfigureAwait(false); diff --git a/Wino.Mail/Activation/ProtocolActivationHandler.cs b/Wino.Mail/Activation/ProtocolActivationHandler.cs index bc18d65f..3227af62 100644 --- a/Wino.Mail/Activation/ProtocolActivationHandler.cs +++ b/Wino.Mail/Activation/ProtocolActivationHandler.cs @@ -4,14 +4,12 @@ using CommunityToolkit.Mvvm.Messaging; using Windows.ApplicationModel.Activation; using Wino.Core.Domain.Interfaces; using Wino.Core.Domain.Models.Launch; -using Wino.Messaging.Client.Authorization; using Wino.Messaging.Client.Shell; namespace Wino.Activation { internal class ProtocolActivationHandler : ActivationHandler { - private const string GoogleAuthorizationProtocolTag = "google.pw.oauth2"; private const string MailtoProtocolTag = "mailto:"; private readonly INativeAppService _nativeAppService; @@ -28,13 +26,7 @@ namespace Wino.Activation // Check URI prefix. var protocolString = args.Uri.AbsoluteUri; - // Google OAuth Response - if (protocolString.StartsWith(GoogleAuthorizationProtocolTag)) - { - // App must be working already. No need to check for running state. - WeakReferenceMessenger.Default.Send(new ProtocolAuthorizationCallbackReceived(args.Uri)); - } - else if (protocolString.StartsWith(MailtoProtocolTag)) + if (protocolString.StartsWith(MailtoProtocolTag)) { // mailto activation. Try to parse params. _launchProtocolService.MailToUri = new MailToUri(protocolString); diff --git a/Wino.Mail/Activation/ToastNotificationActivationHandler.cs b/Wino.Mail/Activation/ToastNotificationActivationHandler.cs index 9f7cb56f..98033f06 100644 --- a/Wino.Mail/Activation/ToastNotificationActivationHandler.cs +++ b/Wino.Mail/Activation/ToastNotificationActivationHandler.cs @@ -1,8 +1,8 @@ using System; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Messaging; +using CommunityToolkit.WinUI.Notifications; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Toolkit.Uwp.Notifications; using Serilog; using Windows.ApplicationModel.Activation; using Wino.Core.Domain; diff --git a/Wino.Mail/Controls/AccountNavigationItem.cs b/Wino.Mail/Controls/AccountNavigationItem.cs index 7172d94b..7d23b443 100644 --- a/Wino.Mail/Controls/AccountNavigationItem.cs +++ b/Wino.Mail/Controls/AccountNavigationItem.cs @@ -6,7 +6,7 @@ using Wino.Core.UWP.Controls; namespace Wino.Controls { - public class AccountNavigationItem : WinoNavigationViewItem + public partial class AccountNavigationItem : WinoNavigationViewItem { public static readonly DependencyProperty IsActiveAccountProperty = DependencyProperty.Register(nameof(IsActiveAccount), typeof(bool), typeof(AccountNavigationItem), new PropertyMetadata(false, new PropertyChangedCallback(OnIsActiveAccountChanged))); diff --git a/Wino.Mail/Controls/Advanced/WinoListView.cs b/Wino.Mail/Controls/Advanced/WinoListView.cs index 48990ea0..90a76cb8 100644 --- a/Wino.Mail/Controls/Advanced/WinoListView.cs +++ b/Wino.Mail/Controls/Advanced/WinoListView.cs @@ -19,7 +19,7 @@ namespace Wino.Controls.Advanced /// Custom ListView control that handles multiple selection with Extended/Multiple selection mode /// and supports threads. /// - public class WinoListView : ListView, IDisposable + public partial class WinoListView : ListView, IDisposable { private ILogger logger = Log.ForContext(); diff --git a/Wino.Mail/Controls/ImagePreviewControl.cs b/Wino.Mail/Controls/ImagePreviewControl.cs index 5a0e9cc1..95eafc5f 100644 --- a/Wino.Mail/Controls/ImagePreviewControl.cs +++ b/Wino.Mail/Controls/ImagePreviewControl.cs @@ -15,7 +15,7 @@ using Wino.Core.UWP.Services; namespace Wino.Controls { - public class ImagePreviewControl : Control + public partial class ImagePreviewControl : Control { private const string PART_EllipseInitialsGrid = "EllipseInitialsGrid"; private const string PART_InitialsTextBlock = "InitialsTextBlock"; diff --git a/Wino.Mail/Controls/SettingsMenuItemControl.cs b/Wino.Mail/Controls/SettingsMenuItemControl.cs index b37b45f7..53dfeb41 100644 --- a/Wino.Mail/Controls/SettingsMenuItemControl.cs +++ b/Wino.Mail/Controls/SettingsMenuItemControl.cs @@ -8,7 +8,7 @@ namespace Wino.Controls /// /// Templated button for each setting in Settings Dialog. /// - public class SettingsMenuItemControl : Control + public partial class SettingsMenuItemControl : Control { public string Title { diff --git a/Wino.Mail/Controls/WinoExpander.cs b/Wino.Mail/Controls/WinoExpander.cs index c286ee0e..268580c8 100644 --- a/Wino.Mail/Controls/WinoExpander.cs +++ b/Wino.Mail/Controls/WinoExpander.cs @@ -7,7 +7,7 @@ using Windows.UI.Xaml.Markup; namespace Wino.Controls { [ContentProperty(Name = nameof(Content))] - public class WinoExpander : Control + public partial class WinoExpander : Control { private const string PART_HeaderGrid = "HeaderGrid"; private const string PART_ContentAreaWrapper = "ContentAreaWrapper"; diff --git a/Wino.Mail/Controls/WinoSwipeControlItems.cs b/Wino.Mail/Controls/WinoSwipeControlItems.cs index eb5cef74..5d560314 100644 --- a/Wino.Mail/Controls/WinoSwipeControlItems.cs +++ b/Wino.Mail/Controls/WinoSwipeControlItems.cs @@ -8,7 +8,7 @@ using Wino.Mail.ViewModels.Data; namespace Wino.Controls { - public class WinoSwipeControlItems : SwipeItems + public partial class WinoSwipeControlItems : SwipeItems { public static readonly DependencyProperty SwipeOperationProperty = DependencyProperty.Register(nameof(SwipeOperation), typeof(MailOperation), typeof(WinoSwipeControlItems), new PropertyMetadata(default(MailOperation), new PropertyChangedCallback(OnItemsChanged))); public static readonly DependencyProperty MailItemProperty = DependencyProperty.Register(nameof(MailItem), typeof(IMailItem), typeof(WinoSwipeControlItems), new PropertyMetadata(null)); diff --git a/Wino.Mail/Dialogs/SignatureEditorDialog.xaml.cs b/Wino.Mail/Dialogs/SignatureEditorDialog.xaml.cs index f8c0a316..f9e744cf 100644 --- a/Wino.Mail/Dialogs/SignatureEditorDialog.xaml.cs +++ b/Wino.Mail/Dialogs/SignatureEditorDialog.xaml.cs @@ -10,7 +10,9 @@ using Windows.UI.Xaml.Controls; using Wino.Core.Domain; using Wino.Core.Domain.Entities.Mail; using Wino.Core.Domain.Interfaces; +using Wino.Core.Domain.Models; using Wino.Core.Domain.Models.Reader; +using Wino.Core.UWP.Extensions; using Wino.Views.Settings; namespace Wino.Dialogs @@ -76,9 +78,9 @@ namespace Wino.Dialogs _getHTMLBodyFunction = new Func>(async () => { - var editorContent = await InvokeScriptSafeAsync("GetHTMLContent();"); + var editorContent = await Chromium.ExecuteScriptFunctionSafeAsync("GetHTMLContent"); - return JsonSerializer.Deserialize(editorContent); + return JsonSerializer.Deserialize(editorContent, BasicTypesJsonContext.Default.String); }); var underlyingThemeService = App.Current.Services.GetService(); @@ -188,22 +190,6 @@ namespace Wino.Dialogs } } - public async Task ExecuteScriptFunctionAsync(string functionName, params object[] parameters) - { - string script = functionName + "("; - for (int i = 0; i < parameters.Length; i++) - { - script += JsonSerializer.Serialize(parameters[i]); - if (i < parameters.Length - 1) - { - script += ", "; - } - } - script += ");"; - - return await Chromium.ExecuteScriptAsync(script); - } - private async Task InvokeScriptSafeAsync(string function) { if (Chromium == null) return string.Empty; @@ -283,11 +269,11 @@ namespace Wino.Dialogs if (string.IsNullOrEmpty(htmlBody)) { - await ExecuteScriptFunctionAsync("RenderHTML", " "); + await Chromium.ExecuteScriptFunctionAsync("RenderHTML", parameters: JsonSerializer.Serialize(" ", BasicTypesJsonContext.Default.String)); } else { - await ExecuteScriptFunctionAsync("RenderHTML", htmlBody); + await Chromium.ExecuteScriptFunctionAsync("RenderHTML", parameters: JsonSerializer.Serialize(htmlBody, BasicTypesJsonContext.Default.String)); await FocusEditorAsync(); } @@ -300,7 +286,12 @@ namespace Wino.Dialogs int composerFontSize = _preferencesService.ComposerFontSize; var readerFont = _preferencesService.ReaderFont; int readerFontSize = _preferencesService.ReaderFontSize; - return await ExecuteScriptFunctionAsync("initializeJodit", fonts, composerFont, composerFontSize, readerFont, readerFontSize); + return await Chromium.ExecuteScriptFunctionAsync("initializeJodit", false, + JsonSerializer.Serialize(fonts, BasicTypesJsonContext.Default.ListString), + JsonSerializer.Serialize(composerFont, BasicTypesJsonContext.Default.String), + JsonSerializer.Serialize(composerFontSize, BasicTypesJsonContext.Default.Int32), + JsonSerializer.Serialize(readerFont, BasicTypesJsonContext.Default.String), + JsonSerializer.Serialize(readerFontSize, BasicTypesJsonContext.Default.Int32)); } private async void ChromiumInitialized(Microsoft.UI.Xaml.Controls.WebView2 sender, Microsoft.UI.Xaml.Controls.CoreWebView2InitializedEventArgs args) @@ -327,7 +318,7 @@ namespace Wino.Dialogs private void ScriptMessageReceived(CoreWebView2 sender, CoreWebView2WebMessageReceivedEventArgs args) { - var change = JsonSerializer.Deserialize(args.WebMessageAsJson); + var change = JsonSerializer.Deserialize(args.WebMessageAsJson, DomainModelsJsonContext.Default.WebViewMessage); if (change.Type == "bold") { diff --git a/Wino.Mail/MenuFlyouts/AccountSelectorFlyout.cs b/Wino.Mail/MenuFlyouts/AccountSelectorFlyout.cs index bb08863d..66db2597 100644 --- a/Wino.Mail/MenuFlyouts/AccountSelectorFlyout.cs +++ b/Wino.Mail/MenuFlyouts/AccountSelectorFlyout.cs @@ -10,7 +10,7 @@ using Wino.Helpers; namespace Wino.MenuFlyouts { - public class AccountSelectorFlyout : MenuFlyout, IDisposable + public partial class AccountSelectorFlyout : MenuFlyout, IDisposable { private readonly IEnumerable _accounts; private readonly Func _onItemSelection; diff --git a/Wino.Mail/MenuFlyouts/FilterMenuFlyout.cs b/Wino.Mail/MenuFlyouts/FilterMenuFlyout.cs index bda772c6..7c4b9a17 100644 --- a/Wino.Mail/MenuFlyouts/FilterMenuFlyout.cs +++ b/Wino.Mail/MenuFlyouts/FilterMenuFlyout.cs @@ -3,14 +3,13 @@ using System.Linq; using CommunityToolkit.Mvvm.Input; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Wino.Controls; using Wino.Core.Domain.Models.Reader; using Wino.Core.UWP.Controls; using Wino.Helpers; namespace Wino.MenuFlyouts { - public class FilterMenuFlyout : MenuFlyout + public partial class FilterMenuFlyout : MenuFlyout { public static readonly DependencyProperty SelectedFilterChangedCommandProperty = DependencyProperty.Register(nameof(SelectedFilterChangedCommand), typeof(IRelayCommand), typeof(FilterMenuFlyout), new PropertyMetadata(null)); public static readonly DependencyProperty FilterOptionsProperty = DependencyProperty.Register(nameof(FilterOptions), typeof(List), typeof(FilterMenuFlyout), new PropertyMetadata(null, new PropertyChangedCallback(OnOptionsChanged))); diff --git a/Wino.Mail/MenuFlyouts/FolderOperationFlyout.cs b/Wino.Mail/MenuFlyouts/FolderOperationFlyout.cs index c3ef1f51..b7a052bc 100644 --- a/Wino.Mail/MenuFlyouts/FolderOperationFlyout.cs +++ b/Wino.Mail/MenuFlyouts/FolderOperationFlyout.cs @@ -6,7 +6,7 @@ using Wino.Core.Domain.Models.Folders; namespace Wino.MenuFlyouts.Context { - public class FolderOperationFlyout : WinoOperationFlyout + public partial class FolderOperationFlyout : WinoOperationFlyout { public FolderOperationFlyout(IEnumerable availableActions, TaskCompletionSource completionSource) : base(availableActions, completionSource) { diff --git a/Wino.Mail/MenuFlyouts/FolderOperationMenuFlyoutItem.cs b/Wino.Mail/MenuFlyouts/FolderOperationMenuFlyoutItem.cs index c6b788c6..e22b7545 100644 --- a/Wino.Mail/MenuFlyouts/FolderOperationMenuFlyoutItem.cs +++ b/Wino.Mail/MenuFlyouts/FolderOperationMenuFlyoutItem.cs @@ -3,7 +3,7 @@ using Wino.Core.Domain.Models.Folders; namespace Wino.MenuFlyouts { - public class FolderOperationMenuFlyoutItem : WinoOperationFlyoutItem + public partial class FolderOperationMenuFlyoutItem : WinoOperationFlyoutItem { public FolderOperationMenuFlyoutItem(FolderOperationMenuItem operationMenuItem, Action clicked) : base(operationMenuItem, clicked) { diff --git a/Wino.Mail/MenuFlyouts/MailOperationFlyout.cs b/Wino.Mail/MenuFlyouts/MailOperationFlyout.cs index a5982881..4bc0521a 100644 --- a/Wino.Mail/MenuFlyouts/MailOperationFlyout.cs +++ b/Wino.Mail/MenuFlyouts/MailOperationFlyout.cs @@ -6,7 +6,7 @@ using Wino.Core.Domain.Models.Menus; namespace Wino.MenuFlyouts.Context { - public class MailOperationFlyout : WinoOperationFlyout + public partial class MailOperationFlyout : WinoOperationFlyout { public MailOperationFlyout(IEnumerable availableActions, TaskCompletionSource completionSource) : base(availableActions, completionSource) { diff --git a/Wino.Mail/MenuFlyouts/MailOperationMenuFlyoutItem.cs b/Wino.Mail/MenuFlyouts/MailOperationMenuFlyoutItem.cs index 51c1953b..d98d2a15 100644 --- a/Wino.Mail/MenuFlyouts/MailOperationMenuFlyoutItem.cs +++ b/Wino.Mail/MenuFlyouts/MailOperationMenuFlyoutItem.cs @@ -3,7 +3,7 @@ using Wino.Core.Domain.Models.Menus; namespace Wino.MenuFlyouts.Context { - public class MailOperationMenuFlyoutItem : WinoOperationFlyoutItem + public partial class MailOperationMenuFlyoutItem : WinoOperationFlyoutItem { public MailOperationMenuFlyoutItem(MailOperationMenuItem operationMenuItem, Action clicked) : base(operationMenuItem, clicked) { diff --git a/Wino.Mail/MenuFlyouts/MoveButtonFlyout.cs b/Wino.Mail/MenuFlyouts/MoveButtonFlyout.cs index c08c979e..8021363d 100644 --- a/Wino.Mail/MenuFlyouts/MoveButtonFlyout.cs +++ b/Wino.Mail/MenuFlyouts/MoveButtonFlyout.cs @@ -13,7 +13,7 @@ namespace Wino.MenuFlyouts public Guid ClickedFolderId { get; set; } } - public class MoveButtonFlyout : MenuFlyout + public partial class MoveButtonFlyout : MenuFlyout { public event TypedEventHandler MenuItemClick; public static readonly DependencyProperty FoldersProperty = DependencyProperty.Register(nameof(Folders), typeof(List), typeof(MoveButtonFlyout), new PropertyMetadata(null, new PropertyChangedCallback(OnFoldersChanged))); diff --git a/Wino.Mail/MenuFlyouts/WinoOperationFlyout.cs b/Wino.Mail/MenuFlyouts/WinoOperationFlyout.cs index 6ecd9996..c9c4c54a 100644 --- a/Wino.Mail/MenuFlyouts/WinoOperationFlyout.cs +++ b/Wino.Mail/MenuFlyouts/WinoOperationFlyout.cs @@ -5,7 +5,7 @@ using Windows.UI.Xaml.Controls; namespace Wino.MenuFlyouts { - public class WinoOperationFlyout : MenuFlyout, IDisposable where TActionType : class + public partial class WinoOperationFlyout : MenuFlyout, IDisposable where TActionType : class { public TActionType ClickedOperation { get; set; } diff --git a/Wino.Mail/MenuFlyouts/WinoOperationFlyoutItem.cs b/Wino.Mail/MenuFlyouts/WinoOperationFlyoutItem.cs index 581a030a..1145569d 100644 --- a/Wino.Mail/MenuFlyouts/WinoOperationFlyoutItem.cs +++ b/Wino.Mail/MenuFlyouts/WinoOperationFlyoutItem.cs @@ -9,7 +9,7 @@ using Wino.Helpers; namespace Wino.MenuFlyouts { - public class WinoOperationFlyoutItem : MenuFlyoutItem, IDisposable where TOperationMenuItem : IMenuOperation + public partial class WinoOperationFlyoutItem : MenuFlyoutItem, IDisposable where TOperationMenuItem : IMenuOperation { private const double CustomHeight = 35; diff --git a/Wino.Mail/Properties/AssemblyInfo.cs b/Wino.Mail/Properties/AssemblyInfo.cs deleted file mode 100644 index c05af972..00000000 --- a/Wino.Mail/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Wino")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wino")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] diff --git a/Wino.Mail/Properties/Default.rd.xml b/Wino.Mail/Properties/Default.rd.xml deleted file mode 100644 index 52ed61e3..00000000 --- a/Wino.Mail/Properties/Default.rd.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Mail/Properties/launchSettings.json b/Wino.Mail/Properties/launchSettings.json new file mode 100644 index 00000000..e1b2e1fa --- /dev/null +++ b/Wino.Mail/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "App1": { + "commandName": "MsixPackage" + } + } +} \ No newline at end of file diff --git a/Wino.Mail/Selectors/AccountProviderViewModelTemplateSelector.cs b/Wino.Mail/Selectors/AccountProviderViewModelTemplateSelector.cs index 18af590f..e260a905 100644 --- a/Wino.Mail/Selectors/AccountProviderViewModelTemplateSelector.cs +++ b/Wino.Mail/Selectors/AccountProviderViewModelTemplateSelector.cs @@ -4,7 +4,7 @@ using Wino.Core.ViewModels.Data; namespace Wino.Selectors { - public class AccountProviderViewModelTemplateSelector : DataTemplateSelector + public partial class AccountProviderViewModelTemplateSelector : DataTemplateSelector { public DataTemplate RootAccountTemplate { get; set; } public DataTemplate MergedAccountTemplate { get; set; } diff --git a/Wino.Mail/Selectors/AccountReorderTemplateSelector.cs b/Wino.Mail/Selectors/AccountReorderTemplateSelector.cs index fc93318c..af2072d6 100644 --- a/Wino.Mail/Selectors/AccountReorderTemplateSelector.cs +++ b/Wino.Mail/Selectors/AccountReorderTemplateSelector.cs @@ -4,7 +4,7 @@ using Wino.Core.ViewModels.Data; namespace Wino.Selectors { - public class AccountReorderTemplateSelector : DataTemplateSelector + public partial class AccountReorderTemplateSelector : DataTemplateSelector { public DataTemplate MergedAccountReorderTemplate { get; set; } public DataTemplate RootAccountReorderTemplate { get; set; } diff --git a/Wino.Mail/Selectors/MailItemContainerStyleSelector.cs b/Wino.Mail/Selectors/MailItemContainerStyleSelector.cs index 17959c3f..f391e843 100644 --- a/Wino.Mail/Selectors/MailItemContainerStyleSelector.cs +++ b/Wino.Mail/Selectors/MailItemContainerStyleSelector.cs @@ -4,7 +4,7 @@ using Wino.Mail.ViewModels.Data; namespace Wino.Selectors { - public class MailItemContainerStyleSelector : StyleSelector + public partial class MailItemContainerStyleSelector : StyleSelector { public Style Thread { get; set; } diff --git a/Wino.Mail/Selectors/MailItemDisplayModePreviewTemplateSelector.cs b/Wino.Mail/Selectors/MailItemDisplayModePreviewTemplateSelector.cs index 55949830..92aaebe9 100644 --- a/Wino.Mail/Selectors/MailItemDisplayModePreviewTemplateSelector.cs +++ b/Wino.Mail/Selectors/MailItemDisplayModePreviewTemplateSelector.cs @@ -7,7 +7,7 @@ namespace Wino.Selectors /// /// Template selector for previewing mail item display modes in Settings->Personalization page. /// - public class MailItemDisplayModePreviewTemplateSelector : DataTemplateSelector + public partial class MailItemDisplayModePreviewTemplateSelector : DataTemplateSelector { public DataTemplate CompactTemplate { get; set; } public DataTemplate MediumTemplate { get; set; } diff --git a/Wino.Mail/Selectors/MailItemDisplaySelector.cs b/Wino.Mail/Selectors/MailItemDisplaySelector.cs index fe7a3cf1..3f7bda23 100644 --- a/Wino.Mail/Selectors/MailItemDisplaySelector.cs +++ b/Wino.Mail/Selectors/MailItemDisplaySelector.cs @@ -4,7 +4,7 @@ using Wino.Mail.ViewModels.Data; namespace Wino.Selectors { - public class MailItemDisplaySelector : DataTemplateSelector + public partial class MailItemDisplaySelector : DataTemplateSelector { public DataTemplate SingleMailItemTemplate { get; set; } public DataTemplate ThreadMailItemTemplate { get; set; } diff --git a/Wino.Mail/Views/Abstract/MailListPageAbstract.cs b/Wino.Mail/Views/Abstract/MailListPageAbstract.cs index b91706dc..84dfb9c0 100644 --- a/Wino.Mail/Views/Abstract/MailListPageAbstract.cs +++ b/Wino.Mail/Views/Abstract/MailListPageAbstract.cs @@ -1,10 +1,6 @@ using Wino.Core.UWP; using Wino.Mail.ViewModels; -namespace Wino.Views.Abstract -{ - public class MailListPageAbstract : BasePage - { +namespace Wino.Views.Abstract; - } -} +public partial class MailListPageAbstract : BasePage; diff --git a/Wino.Mail/Views/ComposePage.xaml.cs b/Wino.Mail/Views/ComposePage.xaml.cs index acaa469a..837828d0 100644 --- a/Wino.Mail/Views/ComposePage.xaml.cs +++ b/Wino.Mail/Views/ComposePage.xaml.cs @@ -4,13 +4,13 @@ using System.Collections.ObjectModel; using System.Linq; using System.Reactive.Linq; using System.Text.Json; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using CommunityToolkit.Mvvm.Messaging; using CommunityToolkit.WinUI.Controls; using EmailValidation; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Toolkit.Uwp.Helpers; using Microsoft.UI.Xaml.Controls; using Microsoft.Web.WebView2.Core; using MimeKit; @@ -27,6 +27,7 @@ using Windows.UI.Xaml.Navigation; using Wino.Core.Domain; using Wino.Core.Domain.Entities.Shared; using Wino.Core.Domain.Interfaces; +using Wino.Core.Domain.Models; using Wino.Core.Domain.Models.Reader; using Wino.Core.UWP.Extensions; using Wino.Mail.ViewModels.Data; @@ -215,7 +216,7 @@ namespace Wino.Views } } - await InvokeScriptSafeAsync($"insertImages({JsonSerializer.Serialize(imagesInformation)});"); + await InvokeScriptSafeAsync($"insertImages({JsonSerializer.Serialize(imagesInformation, ComposerPageJsonContext.Default.ListImageInfo)});"); } } // State should be reset even when an exception occurs, otherwise the UI will be stuck in a dragging state. @@ -227,7 +228,7 @@ namespace Wino.Views static async Task GetDataURL(StorageFile file) { - return $"data:image/{file.FileType.Replace(".", "")};base64,{Convert.ToBase64String(await file.ReadBytesAsync())}"; + return $"data:image/{file.FileType.Replace(".", "")};base64,{Convert.ToBase64String(await file.ToByteArrayAsync())}"; } } @@ -320,22 +321,6 @@ namespace Wino.Views await InvokeScriptSafeAsync($"toggleToolbar('{enable}');"); } - public async Task ExecuteScriptFunctionAsync(string functionName, params object[] parameters) - { - string script = functionName + "("; - for (int i = 0; i < parameters.Length; i++) - { - script += JsonSerializer.Serialize(parameters[i]); - if (i < parameters.Length - 1) - { - script += ", "; - } - } - script += ");"; - - return await Chromium.ExecuteScriptAsync(script); - } - private async Task InvokeScriptSafeAsync(string function) { if (Chromium == null) return string.Empty; @@ -404,11 +389,11 @@ namespace Wino.Views if (string.IsNullOrEmpty(htmlBody)) { - await ExecuteScriptFunctionAsync("RenderHTML", " "); + await Chromium.ExecuteScriptFunctionAsync("RenderHTML", parameters: JsonSerializer.Serialize(" ", BasicTypesJsonContext.Default.String)); } else { - await ExecuteScriptFunctionAsync("RenderHTML", htmlBody); + await Chromium.ExecuteScriptFunctionAsync("RenderHTML", parameters: JsonSerializer.Serialize(htmlBody, BasicTypesJsonContext.Default.String)); } } @@ -419,7 +404,13 @@ namespace Wino.Views int composerFontSize = ViewModel.PreferencesService.ComposerFontSize; var readerFont = ViewModel.PreferencesService.ReaderFont; int readerFontSize = ViewModel.PreferencesService.ReaderFontSize; - return await ExecuteScriptFunctionAsync("initializeJodit", fonts, composerFont, composerFontSize, readerFont, readerFontSize); + return await Chromium.ExecuteScriptFunctionAsync("initializeJodit", + false, + JsonSerializer.Serialize(fonts, BasicTypesJsonContext.Default.ListString), + JsonSerializer.Serialize(composerFont, BasicTypesJsonContext.Default.String), + JsonSerializer.Serialize(composerFontSize, BasicTypesJsonContext.Default.Int32), + JsonSerializer.Serialize(readerFont, BasicTypesJsonContext.Default.String), + JsonSerializer.Serialize(readerFontSize, BasicTypesJsonContext.Default.Int32)); } private void DisposeWebView2() @@ -468,7 +459,7 @@ namespace Wino.Views { var editorContent = await InvokeScriptSafeAsync("GetHTMLContent();"); - return JsonSerializer.Deserialize(editorContent); + return JsonSerializer.Deserialize(editorContent, BasicTypesJsonContext.Default.String); }); var underlyingThemeService = App.Current.Services.GetService(); @@ -492,7 +483,7 @@ namespace Wino.Views private void ScriptMessageReceived(CoreWebView2 sender, CoreWebView2WebMessageReceivedEventArgs args) { - var change = JsonSerializer.Deserialize(args.WebMessageAsJson); + var change = JsonSerializer.Deserialize(args.WebMessageAsJson, DomainModelsJsonContext.Default.WebViewMessage); if (change.Type == "bold") { @@ -698,4 +689,7 @@ namespace Wino.Views finally { deferral.Complete(); } } } + + [JsonSerializable(typeof(List))] + public partial class ComposerPageJsonContext: JsonSerializerContext; } diff --git a/Wino.Mail/Views/MailListPage.xaml b/Wino.Mail/Views/MailListPage.xaml index 2bf17f71..5c6ce501 100644 --- a/Wino.Mail/Views/MailListPage.xaml +++ b/Wino.Mail/Views/MailListPage.xaml @@ -12,7 +12,6 @@ xmlns:enums="using:Wino.Core.Domain.Enums" xmlns:helpers="using:Wino.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:ic="using:Microsoft.Xaml.Interactions.Core" xmlns:interactivity="using:Microsoft.Xaml.Interactivity" xmlns:listview="using:Wino.Controls.Advanced" xmlns:local="using:Wino.Behaviors" @@ -219,9 +218,9 @@ Text="{x:Bind ViewModel.SearchQuery, Mode=TwoWay}" TextChanged="SearchBar_TextChanged"> - - - + + + diff --git a/Wino.Mail/Views/MailRenderingPage.xaml.cs b/Wino.Mail/Views/MailRenderingPage.xaml.cs index 0208d875..347c3828 100644 --- a/Wino.Mail/Views/MailRenderingPage.xaml.cs +++ b/Wino.Mail/Views/MailRenderingPage.xaml.cs @@ -11,7 +11,9 @@ using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media.Animation; using Windows.UI.Xaml.Navigation; +using Wino.Core.Domain; using Wino.Core.Domain.Interfaces; +using Wino.Core.UWP.Extensions; using Wino.Mail.ViewModels.Data; using Wino.Messaging.Client.Mails; using Wino.Messaging.Client.Shell; @@ -65,22 +67,6 @@ namespace Wino.Views return string.Empty; } - public async Task ExecuteScriptFunctionAsync(string functionName, params object[] parameters) - { - string script = functionName + "("; - for (int i = 0; i < parameters.Length; i++) - { - script += JsonSerializer.Serialize(parameters[i]); - if (i < parameters.Length - 1) - { - script += ", "; - } - } - script += ");"; - - return isChromiumDisposed ? string.Empty : await Chromium.ExecuteScriptAsync(script); - } - private async Task RenderInternalAsync(string htmlBody) { isRenderingInProgress = true; @@ -92,12 +78,14 @@ namespace Wino.Views if (string.IsNullOrEmpty(htmlBody)) { - await ExecuteScriptFunctionAsync("RenderHTML", " "); + await Chromium.ExecuteScriptFunctionAsync("RenderHTML", isChromiumDisposed, JsonSerializer.Serialize(" ", BasicTypesJsonContext.Default.String)); } else { var shouldLinkifyText = ViewModel.CurrentRenderModel?.MailRenderingOptions?.RenderPlaintextLinks ?? true; - await ExecuteScriptFunctionAsync("RenderHTML", htmlBody, shouldLinkifyText); + await Chromium.ExecuteScriptFunctionAsync("RenderHTML", isChromiumDisposed, + JsonSerializer.Serialize(htmlBody, BasicTypesJsonContext.Default.String), + JsonSerializer.Serialize(shouldLinkifyText, BasicTypesJsonContext.Default.Boolean)); } isRenderingInProgress = false; @@ -133,8 +121,6 @@ namespace Wino.Views { base.OnNavigatedFrom(e); - WeakReferenceMessenger.Default.Send(new CancelRenderingContentRequested()); - // Disposing the page. // Make sure the WebView2 is disposed properly. @@ -263,7 +249,7 @@ namespace Wino.Views private async Task UpdateReaderFontPropertiesAsync() { - await ExecuteScriptFunctionAsync("ChangeFontSize", _preferencesService.ReaderFontSize); + await Chromium.ExecuteScriptFunctionAsync("ChangeFontSize", isChromiumDisposed, JsonSerializer.Serialize(_preferencesService.ReaderFontSize, BasicTypesJsonContext.Default.Int32)); // Prepare font family name with fallback to sans-serif by default. var fontName = _preferencesService.ReaderFont; @@ -271,7 +257,7 @@ namespace Wino.Views // If font family name is not supported by the browser, fallback to sans-serif. fontName += ", sans-serif"; - await ExecuteScriptFunctionAsync("ChangeFontFamily", fontName); + await Chromium.ExecuteScriptFunctionAsync("ChangeFontFamily", isChromiumDisposed, JsonSerializer.Serialize(fontName, BasicTypesJsonContext.Default.String)); } void IRecipient.Receive(ApplicationThemeChanged message) diff --git a/Wino.Mail/Views/WelcomePage.xaml.cs b/Wino.Mail/Views/WelcomePage.xaml.cs index 6a87a21a..b70a1c8a 100644 --- a/Wino.Mail/Views/WelcomePage.xaml.cs +++ b/Wino.Mail/Views/WelcomePage.xaml.cs @@ -1,17 +1,16 @@ using CommunityToolkit.Labs.WinUI.MarkdownTextBlock; using Wino.Views.Abstract; -namespace Wino.Views +namespace Wino.Views; + +public sealed partial class WelcomePage : WelcomePageAbstract { - public sealed partial class WelcomePage : WelcomePageAbstract + private readonly MarkdownConfig _config; + + public WelcomePage() { - private readonly MarkdownConfig _config; + InitializeComponent(); - public WelcomePage() - { - InitializeComponent(); - - _config = new MarkdownConfig(); - } + _config = new MarkdownConfig(); } } diff --git a/Wino.Mail/Wino.Mail.csproj b/Wino.Mail/Wino.Mail.csproj index 203ee932..ffe1f917 100644 --- a/Wino.Mail/Wino.Mail.csproj +++ b/Wino.Mail/Wino.Mail.csproj @@ -1,638 +1,112 @@ - - - - - 8.0 - PackageReference - - false - 3B34414D49FBF00A35A040085092D8699459EA8E - Wino.Mail_TemporaryKey.pfx - - - Debug - x86 - {68A432B8-C1B7-494C-8D6D-230788EA683E} - AppContainerExe - Properties - Wino.Mail - Wino.Mail - en-US - UAP - 10.0.22621.0 - 10.0.17763.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - true - False - SHA256 - False - True - Always - x86|x64|arm64 - 0 - True - True - C:\Users\bkaan\Desktop\Packages\ - True - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - x86 - false - prompt - true - - true - false - true - true - - - - true - bin\ARM64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - ARM64 - false - prompt - true - - - bin\ARM64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - ARM64 - false - prompt - false - - true - false - true - true - true - - - true - bin\x64\Debug\ - TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;CODE_ANALYSIS;MAIL - - - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - x64 - false - prompt - - true - false - true - true - - - - 1.2.2 - - - 1.0.0 - - - 8.3.2 - - - 8.3.2 - - - 0.1.240917-build.1755 - - - 8.3.2 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 8.1.240916 - - - 1.2.0 - - - 5.0.6 - - - 5.0.6 - - - 8.0.1 - - - 4.66.2 - - - 2.2.12-rel-33220-00 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 6.2.14 - - - 2.8.6 - - - 2.0.1 - - - 5.1.2 - - - 4.1.0 - - - 8.4.0 - - - 1.9.172 - - - 1.28.0 - - - - - - - - - - - - - - - - AccountReorderDialog.xaml - - - MessageSourceDialog.xaml - - - MoveMailDialog.xaml - - - SignatureEditorDialog.xaml - - - NewImapSetupDialog.xaml - - - CreateAccountAliasDialog.xaml - - - SystemFolderConfigurationDialog.xaml - - - - - - - - - - - - - MailItemDisplayInformationControl.xaml - - - - - - - - - - - - - - WinoExpanderStyle.xaml - - - AboutPage.xaml - - - - - - - - - - - - - - - - - - - - AccountDetailsPage.xaml - - - AccountManagementPage.xaml - - - MergedAccountDetailsPage.xaml - - - ComposePage.xaml - - - IdlePage.xaml - - - AdvancedImapSetupPage.xaml - - - ImapConnectionFailedPage.xaml - - - PreparingImapFoldersPage.xaml - - - TestingImapConnectionPage.xaml - - - WelcomeImapSetupPage.xaml - - - MailListPage.xaml - - - MailRenderingPage.xaml - - - PersonalizationPage.xaml - - - AppPreferencesPage.xaml - - - LanguageTimePage.xaml - - - MessageListPage.xaml - - - AppShell.xaml - - - ReadComposePanePage.xaml - - - AliasManagementPage.xaml - - - SignatureManagementPage.xaml - - - WelcomePage.xaml - - - - - App.xaml - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - - - {d9ef0f59-f5f2-4d6c-a5ba-84043d8f3e08} - Wino.BackgroundTasks - - - {CF3312E5-5DA0-4867-9945-49EA7598AF1F} - Wino.Core.Domain - - - {395f19ba-1e42-495c-9db5-1a6f537fccb8} - Wino.Core.UWP - - - {53723ae8-7e7e-4d54-adab-0a6033255cc8} - Wino.Core.ViewModels - - - {d62f1c03-da57-4709-a640-0283296a8e66} - Wino.Mail.ViewModels - - - {0c307d7e-256f-448c-8265-5622a812fbcc} - Wino.Messaging - - - {4000a374-59fe-4400-acf6-d40473becd73} - Wino.Services - - - - - Windows Desktop Extensions for the UWP - - - - - 14.0 - - - - \ No newline at end of file + + + WinExe + net9.0-windows10.0.26100.0 + 10.0.18362.0 + true + x86;x64;arm64 + win-x86;win-x64;win-arm64 + en-US + + win-$(Platform).pubxml + true + true + + True + True + SHA256 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wino.Mail/Wino.sln b/Wino.Mail/Wino.sln deleted file mode 100644 index eee1b122..00000000 --- a/Wino.Mail/Wino.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wino.Mail", "Wino.Mail.csproj", "{0B5C02DC-6B11-437C-9C46-EAB6430C3155}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0B5C02DC-6B11-437C-9C46-EAB6430C3155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B5C02DC-6B11-437C-9C46-EAB6430C3155}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B5C02DC-6B11-437C-9C46-EAB6430C3155}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B5C02DC-6B11-437C-9C46-EAB6430C3155}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {0254B19E-9B52-4594-9F8A-8616BE750243} - EndGlobalSection -EndGlobal diff --git a/Wino.Messages/Client/Authorization/ProtocolAuthorizationCallbackReceived.cs b/Wino.Messages/Client/Authorization/ProtocolAuthorizationCallbackReceived.cs deleted file mode 100644 index 4eeca244..00000000 --- a/Wino.Messages/Client/Authorization/ProtocolAuthorizationCallbackReceived.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using Wino.Core.Domain.Interfaces; - -namespace Wino.Messaging.Client.Authorization -{ - /// - /// When Google authentication makes a callback to the app via protocol activation to the app. - /// App will send this message back to server to continue authorization there. - /// - /// Callback Uri that Google returned. - public record ProtocolAuthorizationCallbackReceived(Uri AuthorizationResponseUri) : IClientMessage; -} diff --git a/Wino.Messages/CommunicationMessagesContext.cs b/Wino.Messages/CommunicationMessagesContext.cs new file mode 100644 index 00000000..49719f77 --- /dev/null +++ b/Wino.Messages/CommunicationMessagesContext.cs @@ -0,0 +1,26 @@ +using System.Text.Json.Serialization; +using Wino.Messaging.UI; + +namespace Wino.Messaging; + +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(MailAddedMessage))] +[JsonSerializable(typeof(MailDownloadedMessage))] +[JsonSerializable(typeof(MailRemovedMessage))] +[JsonSerializable(typeof(MailUpdatedMessage))] +[JsonSerializable(typeof(AccountCreatedMessage))] +[JsonSerializable(typeof(AccountRemovedMessage))] +[JsonSerializable(typeof(AccountUpdatedMessage))] +[JsonSerializable(typeof(DraftCreated))] +[JsonSerializable(typeof(DraftFailed))] +[JsonSerializable(typeof(DraftMapped))] +[JsonSerializable(typeof(FolderRenamed))] +[JsonSerializable(typeof(FolderSynchronizationEnabled))] +[JsonSerializable(typeof(MergedInboxRenamed))] +[JsonSerializable(typeof(AccountSynchronizationCompleted))] +[JsonSerializable(typeof(RefreshUnreadCountsMessage))] +[JsonSerializable(typeof(AccountSynchronizerStateChanged))] +[JsonSerializable(typeof(AccountSynchronizationProgressUpdatedMessage))] +[JsonSerializable(typeof(AccountFolderConfigurationUpdated))] +[JsonSerializable(typeof(CopyAuthURLRequested))] +public partial class CommunicationMessagesContext : JsonSerializerContext; diff --git a/Wino.Messages/Wino.Messaging.csproj b/Wino.Messages/Wino.Messaging.csproj index c012b615..7cc4e76c 100644 --- a/Wino.Messages/Wino.Messaging.csproj +++ b/Wino.Messages/Wino.Messaging.csproj @@ -1,24 +1,18 @@  - - - netstandard2.0 - 12 - AnyCPU;x64;x86 - - true - true - - - - - - + + net9.0 + x86;x64;arm64 + win-x86;win-x64;win-arm64 + true + true + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + - - + + + + + + + \ No newline at end of file diff --git a/Wino.Packaging/Wino.Packaging.wapproj b/Wino.Packaging/Wino.Packaging.wapproj index c66a9cdc..0de3e109 100644 --- a/Wino.Packaging/Wino.Packaging.wapproj +++ b/Wino.Packaging/Wino.Packaging.wapproj @@ -1,6 +1,7 @@ + 15.0 @@ -30,13 +31,17 @@ + AppHostLocalDebugger + False + CoreClr + true $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ 760f5f31-8ee3-4b83-80f3-0e4ffbcc737c 10.0.22621.0 - 10.0.17763.0 + 10.0.18362.0 en-US false $(NoWarn);NU1702 @@ -129,10 +134,13 @@ - + + True + True + - + \ No newline at end of file diff --git a/Wino.Server/Core/ServerMessageHandlerFactory.cs b/Wino.Server/Core/ServerMessageHandlerFactory.cs index 790bf021..5792cfc3 100644 --- a/Wino.Server/Core/ServerMessageHandlerFactory.cs +++ b/Wino.Server/Core/ServerMessageHandlerFactory.cs @@ -2,7 +2,6 @@ using Microsoft.Extensions.DependencyInjection; using Wino.Core.Domain.Models.Requests; using Wino.Core.Domain.Models.Synchronization; -using Wino.Messaging.Client.Authorization; using Wino.Messaging.Server; using Wino.Server.MessageHandlers; @@ -19,7 +18,6 @@ namespace Wino.Server.Core nameof(ServerRequestPackage) => App.Current.Services.GetService(), nameof(DownloadMissingMessageRequested) => App.Current.Services.GetService(), nameof(AuthorizationRequested) => App.Current.Services.GetService(), - nameof(ProtocolAuthorizationCallbackReceived) => App.Current.Services.GetService(), nameof(SynchronizationExistenceCheckRequest) => App.Current.Services.GetService(), nameof(ServerTerminationModeChanged) => App.Current.Services.GetService(), nameof(TerminateServerRequested) => App.Current.Services.GetService(), @@ -37,7 +35,6 @@ namespace Wino.Server.Core serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); - serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); diff --git a/Wino.Server/MessageHandlers/ProtocolAuthActivationHandler.cs b/Wino.Server/MessageHandlers/ProtocolAuthActivationHandler.cs deleted file mode 100644 index b9393f52..00000000 --- a/Wino.Server/MessageHandlers/ProtocolAuthActivationHandler.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Wino.Core.Domain.Interfaces; -using Wino.Core.Domain.Models.Server; -using Wino.Messaging.Client.Authorization; -using Wino.Server.Core; - -namespace Wino.Server.MessageHandlers -{ - public class ProtocolAuthActivationHandler : ServerMessageHandler - { - public override WinoServerResponse FailureDefaultResponse(Exception ex) => WinoServerResponse.CreateErrorResponse(ex.Message); - - private readonly INativeAppService _nativeAppService; - - public ProtocolAuthActivationHandler(INativeAppService nativeAppService) - { - _nativeAppService = nativeAppService; - } - - protected override Task> HandleAsync(ProtocolAuthorizationCallbackReceived message, CancellationToken cancellationToken = default) - { - _nativeAppService.ContinueAuthorization(message.AuthorizationResponseUri); - - return Task.FromResult(WinoServerResponse.CreateSuccessResponse(true)); - } - } -} diff --git a/Wino.Server/ServerContext.cs b/Wino.Server/ServerContext.cs index e7b21e62..0f30a26d 100644 --- a/Wino.Server/ServerContext.cs +++ b/Wino.Server/ServerContext.cs @@ -14,7 +14,6 @@ using Wino.Core.Domain.Models.Requests; using Wino.Core.Domain.Models.Synchronization; using Wino.Core.Integration.Json; using Wino.Messaging; -using Wino.Messaging.Client.Authorization; using Wino.Messaging.Enums; using Wino.Messaging.Server; using Wino.Messaging.UI; @@ -306,12 +305,6 @@ namespace Wino.Server await ExecuteServerMessageSafeAsync(args, JsonSerializer.Deserialize(messageJson, _jsonSerializerOptions)); break; - case nameof(ProtocolAuthorizationCallbackReceived): - Debug.WriteLine($"Continuing authorization from protocol activation."); - - await ExecuteServerMessageSafeAsync(args, JsonSerializer.Deserialize(messageJson, _jsonSerializerOptions)); - break; - case nameof(SynchronizationExistenceCheckRequest): await ExecuteServerMessageSafeAsync(args, JsonSerializer.Deserialize(messageJson, _jsonSerializerOptions)); diff --git a/Wino.Server/Wino.Server.csproj b/Wino.Server/Wino.Server.csproj index b886e60f..fccfbe9a 100644 --- a/Wino.Server/Wino.Server.csproj +++ b/Wino.Server/Wino.Server.csproj @@ -1,49 +1,49 @@  - - net8.0-windows10.0.22621.0 - 10.0.19041.0 - WinExe - true - true - true - - true - 10.0.22621.0 - x64;x86;ARM32;ARM64 - - - Wino.Server.App - - - - - - - - - - - - - - - - - Always - - - - - - - - - - - - - - - - - + + net9.0-windows10.0.19041.0 + 10.0.19041.0 + WinExe + true + true + true + true + 10.0.22621.0 + x64;x86;ARM64 + false + + + Wino.Server.App + + + + + + + + + + + + + + + + + Always + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Wino.Services/FolderService.cs b/Wino.Services/FolderService.cs index 3b970e11..109ddecc 100644 --- a/Wino.Services/FolderService.cs +++ b/Wino.Services/FolderService.cs @@ -303,7 +303,7 @@ namespace Wino.Services private HashSet FindCommonFolders(List> lists) { - var allSpecialTypesExceptOther = Enum.GetValues(typeof(SpecialFolderType)).Cast().Where(a => a != SpecialFolderType.Other).ToList(); + var allSpecialTypesExceptOther = Enum.GetValues().Cast().Where(a => a != SpecialFolderType.Other).ToList(); // Start with all special folder types from the first list var commonSpecialFolderTypes = new HashSet(allSpecialTypesExceptOther); diff --git a/Wino.Services/TranslationService.cs b/Wino.Services/TranslationService.cs index dc94dfc2..5a351a1f 100644 --- a/Wino.Services/TranslationService.cs +++ b/Wino.Services/TranslationService.cs @@ -40,11 +40,11 @@ namespace Wino.Services if (ignoreCurrentLanguageCheck && isInitialized) return; var currentDictionary = Translator.Resources; - using var resourceStream = currentDictionary.GetLanguageStream(language); + await using var resourceStream = Core.Domain.Translations.WinoTranslationDictionary.GetLanguageStream(language); - var stremValue = await new StreamReader(resourceStream).ReadToEndAsync().ConfigureAwait(false); + var streamValue = await new StreamReader(resourceStream).ReadToEndAsync().ConfigureAwait(false); - var translationLookups = JsonSerializer.Deserialize>(stremValue); + var translationLookups = JsonSerializer.Deserialize(streamValue, BasicTypesJsonContext.Default.DictionaryStringString); // Insert new translation key-value pairs. // Overwrite existing values for the same keys. @@ -52,14 +52,7 @@ namespace Wino.Services foreach (var pair in translationLookups) { // Replace existing value. - if (currentDictionary.ContainsKey(pair.Key)) - { - currentDictionary[pair.Key] = pair.Value; - } - else - { - currentDictionary.Add(pair.Key, pair.Value); - } + currentDictionary[pair.Key] = pair.Value; } _preferencesService.CurrentLanguage = language; diff --git a/Wino.Services/Wino.Services.csproj b/Wino.Services/Wino.Services.csproj index 718d9107..8117e81f 100644 --- a/Wino.Services/Wino.Services.csproj +++ b/Wino.Services/Wino.Services.csproj @@ -1,25 +1,22 @@  - - - netstandard2.0 - 12.0 - true - - - - - - - - - - - - - - - - - - - + + net9.0 + x86;x64;arm64 + win-x86;win-x64;win-arm64 + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Wino.SourceGenerators/Wino.SourceGenerators.csproj b/Wino.SourceGenerators/Wino.SourceGenerators.csproj index dba6e9d2..6e8a004c 100644 --- a/Wino.SourceGenerators/Wino.SourceGenerators.csproj +++ b/Wino.SourceGenerators/Wino.SourceGenerators.csproj @@ -2,11 +2,11 @@ netstandard2.0 - latest enable false AnyCPU true + false @@ -18,9 +18,9 @@ - - - + + + diff --git a/WinoMail.Packaging/Images/LargeTile.scale-100.png b/WinoMail.Packaging/Images/LargeTile.scale-100.png new file mode 100644 index 00000000..aca6e4e2 Binary files /dev/null and b/WinoMail.Packaging/Images/LargeTile.scale-100.png differ diff --git a/WinoMail.Packaging/Images/LargeTile.scale-125.png b/WinoMail.Packaging/Images/LargeTile.scale-125.png new file mode 100644 index 00000000..b80bf9d4 Binary files /dev/null and b/WinoMail.Packaging/Images/LargeTile.scale-125.png differ diff --git a/WinoMail.Packaging/Images/LargeTile.scale-150.png b/WinoMail.Packaging/Images/LargeTile.scale-150.png new file mode 100644 index 00000000..1ed2a001 Binary files /dev/null and b/WinoMail.Packaging/Images/LargeTile.scale-150.png differ diff --git a/WinoMail.Packaging/Images/LargeTile.scale-200.png b/WinoMail.Packaging/Images/LargeTile.scale-200.png new file mode 100644 index 00000000..a8e471dd Binary files /dev/null and b/WinoMail.Packaging/Images/LargeTile.scale-200.png differ diff --git a/WinoMail.Packaging/Images/LargeTile.scale-400.png b/WinoMail.Packaging/Images/LargeTile.scale-400.png new file mode 100644 index 00000000..54cea310 Binary files /dev/null and b/WinoMail.Packaging/Images/LargeTile.scale-400.png differ diff --git a/WinoMail.Packaging/Images/LockScreenLogo.scale-200.png b/WinoMail.Packaging/Images/LockScreenLogo.scale-200.png new file mode 100644 index 00000000..735f57ad Binary files /dev/null and b/WinoMail.Packaging/Images/LockScreenLogo.scale-200.png differ diff --git a/WinoMail.Packaging/Images/SmallTile.scale-100.png b/WinoMail.Packaging/Images/SmallTile.scale-100.png new file mode 100644 index 00000000..f0d52390 Binary files /dev/null and b/WinoMail.Packaging/Images/SmallTile.scale-100.png differ diff --git a/WinoMail.Packaging/Images/SmallTile.scale-125.png b/WinoMail.Packaging/Images/SmallTile.scale-125.png new file mode 100644 index 00000000..4a0404cf Binary files /dev/null and b/WinoMail.Packaging/Images/SmallTile.scale-125.png differ diff --git a/WinoMail.Packaging/Images/SmallTile.scale-150.png b/WinoMail.Packaging/Images/SmallTile.scale-150.png new file mode 100644 index 00000000..f801334e Binary files /dev/null and b/WinoMail.Packaging/Images/SmallTile.scale-150.png differ diff --git a/WinoMail.Packaging/Images/SmallTile.scale-200.png b/WinoMail.Packaging/Images/SmallTile.scale-200.png new file mode 100644 index 00000000..bb2c20c9 Binary files /dev/null and b/WinoMail.Packaging/Images/SmallTile.scale-200.png differ diff --git a/WinoMail.Packaging/Images/SmallTile.scale-400.png b/WinoMail.Packaging/Images/SmallTile.scale-400.png new file mode 100644 index 00000000..c931a5dd Binary files /dev/null and b/WinoMail.Packaging/Images/SmallTile.scale-400.png differ diff --git a/WinoMail.Packaging/Images/SplashScreen.scale-100.png b/WinoMail.Packaging/Images/SplashScreen.scale-100.png new file mode 100644 index 00000000..23c8f147 Binary files /dev/null and b/WinoMail.Packaging/Images/SplashScreen.scale-100.png differ diff --git a/WinoMail.Packaging/Images/SplashScreen.scale-125.png b/WinoMail.Packaging/Images/SplashScreen.scale-125.png new file mode 100644 index 00000000..ceb2dff6 Binary files /dev/null and b/WinoMail.Packaging/Images/SplashScreen.scale-125.png differ diff --git a/WinoMail.Packaging/Images/SplashScreen.scale-150.png b/WinoMail.Packaging/Images/SplashScreen.scale-150.png new file mode 100644 index 00000000..885d9bc2 Binary files /dev/null and b/WinoMail.Packaging/Images/SplashScreen.scale-150.png differ diff --git a/WinoMail.Packaging/Images/SplashScreen.scale-200.png b/WinoMail.Packaging/Images/SplashScreen.scale-200.png new file mode 100644 index 00000000..58c8ca7c Binary files /dev/null and b/WinoMail.Packaging/Images/SplashScreen.scale-200.png differ diff --git a/WinoMail.Packaging/Images/SplashScreen.scale-400.png b/WinoMail.Packaging/Images/SplashScreen.scale-400.png new file mode 100644 index 00000000..fa77f2b7 Binary files /dev/null and b/WinoMail.Packaging/Images/SplashScreen.scale-400.png differ diff --git a/WinoMail.Packaging/Images/Square150x150Logo.scale-100.png b/WinoMail.Packaging/Images/Square150x150Logo.scale-100.png new file mode 100644 index 00000000..a5f235b8 Binary files /dev/null and b/WinoMail.Packaging/Images/Square150x150Logo.scale-100.png differ diff --git a/WinoMail.Packaging/Images/Square150x150Logo.scale-125.png b/WinoMail.Packaging/Images/Square150x150Logo.scale-125.png new file mode 100644 index 00000000..be92b5ae Binary files /dev/null and b/WinoMail.Packaging/Images/Square150x150Logo.scale-125.png differ diff --git a/WinoMail.Packaging/Images/Square150x150Logo.scale-150.png b/WinoMail.Packaging/Images/Square150x150Logo.scale-150.png new file mode 100644 index 00000000..d0039797 Binary files /dev/null and b/WinoMail.Packaging/Images/Square150x150Logo.scale-150.png differ diff --git a/WinoMail.Packaging/Images/Square150x150Logo.scale-200.png b/WinoMail.Packaging/Images/Square150x150Logo.scale-200.png new file mode 100644 index 00000000..430e6fa3 Binary files /dev/null and b/WinoMail.Packaging/Images/Square150x150Logo.scale-200.png differ diff --git a/WinoMail.Packaging/Images/Square150x150Logo.scale-400.png b/WinoMail.Packaging/Images/Square150x150Logo.scale-400.png new file mode 100644 index 00000000..9726829b Binary files /dev/null and b/WinoMail.Packaging/Images/Square150x150Logo.scale-400.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png new file mode 100644 index 00000000..4d6b9dfe Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png new file mode 100644 index 00000000..c0aa2ba3 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png new file mode 100644 index 00000000..7be00300 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png new file mode 100644 index 00000000..a6e4b0a2 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png new file mode 100644 index 00000000..07514cc2 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-16.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-16.png new file mode 100644 index 00000000..4d6b9dfe Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-256.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-256.png new file mode 100644 index 00000000..7be00300 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-32.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-32.png new file mode 100644 index 00000000..a6e4b0a2 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-32.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-48.png b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-48.png new file mode 100644 index 00000000..07514cc2 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.scale-100.png b/WinoMail.Packaging/Images/Square44x44Logo.scale-100.png new file mode 100644 index 00000000..7432521d Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.scale-100.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.scale-125.png b/WinoMail.Packaging/Images/Square44x44Logo.scale-125.png new file mode 100644 index 00000000..fe38dbdf Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.scale-125.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.scale-150.png b/WinoMail.Packaging/Images/Square44x44Logo.scale-150.png new file mode 100644 index 00000000..1ee950af Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.scale-150.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.scale-200.png b/WinoMail.Packaging/Images/Square44x44Logo.scale-200.png new file mode 100644 index 00000000..807e9ed4 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.scale-200.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.scale-400.png b/WinoMail.Packaging/Images/Square44x44Logo.scale-400.png new file mode 100644 index 00000000..f4457476 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.scale-400.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.targetsize-16.png b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-16.png new file mode 100644 index 00000000..9acb3cc8 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-16.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.targetsize-24.png b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-24.png new file mode 100644 index 00000000..c1e08a4f Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-24.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 00000000..c0aa2ba3 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.targetsize-256.png b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-256.png new file mode 100644 index 00000000..37f8decd Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-256.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.targetsize-32.png b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-32.png new file mode 100644 index 00000000..93c856d9 Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-32.png differ diff --git a/WinoMail.Packaging/Images/Square44x44Logo.targetsize-48.png b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-48.png new file mode 100644 index 00000000..a2ca3afc Binary files /dev/null and b/WinoMail.Packaging/Images/Square44x44Logo.targetsize-48.png differ diff --git a/WinoMail.Packaging/Images/StoreLogo.backup.png b/WinoMail.Packaging/Images/StoreLogo.backup.png new file mode 100644 index 00000000..7385b56c Binary files /dev/null and b/WinoMail.Packaging/Images/StoreLogo.backup.png differ diff --git a/WinoMail.Packaging/Images/StoreLogo.scale-100.png b/WinoMail.Packaging/Images/StoreLogo.scale-100.png new file mode 100644 index 00000000..4c4b4b34 Binary files /dev/null and b/WinoMail.Packaging/Images/StoreLogo.scale-100.png differ diff --git a/WinoMail.Packaging/Images/StoreLogo.scale-125.png b/WinoMail.Packaging/Images/StoreLogo.scale-125.png new file mode 100644 index 00000000..1c325127 Binary files /dev/null and b/WinoMail.Packaging/Images/StoreLogo.scale-125.png differ diff --git a/WinoMail.Packaging/Images/StoreLogo.scale-150.png b/WinoMail.Packaging/Images/StoreLogo.scale-150.png new file mode 100644 index 00000000..bb194ef7 Binary files /dev/null and b/WinoMail.Packaging/Images/StoreLogo.scale-150.png differ diff --git a/WinoMail.Packaging/Images/StoreLogo.scale-200.png b/WinoMail.Packaging/Images/StoreLogo.scale-200.png new file mode 100644 index 00000000..b77a5ddc Binary files /dev/null and b/WinoMail.Packaging/Images/StoreLogo.scale-200.png differ diff --git a/WinoMail.Packaging/Images/StoreLogo.scale-400.png b/WinoMail.Packaging/Images/StoreLogo.scale-400.png new file mode 100644 index 00000000..8d0a133e Binary files /dev/null and b/WinoMail.Packaging/Images/StoreLogo.scale-400.png differ diff --git a/WinoMail.Packaging/Images/Wide310x150Logo.scale-100.png b/WinoMail.Packaging/Images/Wide310x150Logo.scale-100.png new file mode 100644 index 00000000..f330133d Binary files /dev/null and b/WinoMail.Packaging/Images/Wide310x150Logo.scale-100.png differ diff --git a/WinoMail.Packaging/Images/Wide310x150Logo.scale-125.png b/WinoMail.Packaging/Images/Wide310x150Logo.scale-125.png new file mode 100644 index 00000000..e4656fa7 Binary files /dev/null and b/WinoMail.Packaging/Images/Wide310x150Logo.scale-125.png differ diff --git a/WinoMail.Packaging/Images/Wide310x150Logo.scale-150.png b/WinoMail.Packaging/Images/Wide310x150Logo.scale-150.png new file mode 100644 index 00000000..884084b3 Binary files /dev/null and b/WinoMail.Packaging/Images/Wide310x150Logo.scale-150.png differ diff --git a/WinoMail.Packaging/Images/Wide310x150Logo.scale-200.png b/WinoMail.Packaging/Images/Wide310x150Logo.scale-200.png new file mode 100644 index 00000000..23c8f147 Binary files /dev/null and b/WinoMail.Packaging/Images/Wide310x150Logo.scale-200.png differ diff --git a/WinoMail.Packaging/Images/Wide310x150Logo.scale-400.png b/WinoMail.Packaging/Images/Wide310x150Logo.scale-400.png new file mode 100644 index 00000000..58c8ca7c Binary files /dev/null and b/WinoMail.Packaging/Images/Wide310x150Logo.scale-400.png differ diff --git a/WinoMail.Packaging/Package.appxmanifest b/WinoMail.Packaging/Package.appxmanifest new file mode 100644 index 00000000..2c69a971 --- /dev/null +++ b/WinoMail.Packaging/Package.appxmanifest @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + Wino Mail + Burak KÖSE + Images\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + Wino Google Authentication Protocol + + + + + + + + Wino Mail Launcher Protocol + + + + + + + EML\eml.png + + .eml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WinoMail.Packaging/WinoMail.Packaging.wapproj b/WinoMail.Packaging/WinoMail.Packaging.wapproj new file mode 100644 index 00000000..a6cc0375 --- /dev/null +++ b/WinoMail.Packaging/WinoMail.Packaging.wapproj @@ -0,0 +1,155 @@ + + + + 15.0 + + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + Debug + ARM64 + + + Release + ARM64 + + + + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ + + + AppHostLocalDebugger + False + CoreClr + + + + ee28910b-6418-4ec2-8f4b-8e85a2e75af7 + 10.0.26100.0 + 10.0.17763.0 + en-US + False + $(NoWarn);NU1702 + ..\Wino.Mail\Wino.Mail.csproj + SHA256 + x86|x64|arm64 + False + True + True + True + 0 + true + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + Package.appxmanifest + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Properties\PublishProfiles\win-$(Platform).pubxml + + + + \ No newline at end of file diff --git a/WinoMail.slnx b/WinoMail.slnx new file mode 100644 index 00000000..b0096dc3 --- /dev/null +++ b/WinoMail.slnx @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nuget.config b/nuget.config index 93db49e0..4745c168 100644 --- a/nuget.config +++ b/nuget.config @@ -1,9 +1,22 @@  - - - - - - + + + + + + + + + + + + + + + + + +