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/Translations/en_US/resources.json b/Wino.Core.Domain/Translations/en_US/resources.json
index 01c35517..44c5bbb8 100644
--- a/Wino.Core.Domain/Translations/en_US/resources.json
+++ b/Wino.Core.Domain/Translations/en_US/resources.json
@@ -521,6 +521,7 @@
"SettingsSignature_AddCustomSignature_Button": "Add signature",
"SettingsSignature_EditSignature_Title": "Edit signature",
"SettingsSignature_DeleteSignature_Title": "Delete signature",
- "SettingsSignature_NoneSignatureName": "None"
-
+ "SettingsSignature_NoneSignatureName": "None",
+ "WinoSystemTray_LaunchWino": "Launch Wino",
+ "WinoSystemTray_QuitWino": "Quit"
}
diff --git a/Wino.Core.Domain/Wino.Core.Domain.NET8.csproj b/Wino.Core.Domain/Wino.Core.Domain.NET8.csproj
index 33b44636..7dc4c8e4 100644
--- a/Wino.Core.Domain/Wino.Core.Domain.NET8.csproj
+++ b/Wino.Core.Domain/Wino.Core.Domain.NET8.csproj
@@ -56,6 +56,9 @@
+
+
+
diff --git a/Wino.Core.UWP/Services/StatePersistenceService.cs b/Wino.Core.UWP/Services/StatePersistenceService.cs
index e94067ed..12c232f3 100644
--- a/Wino.Core.UWP/Services/StatePersistenceService.cs
+++ b/Wino.Core.UWP/Services/StatePersistenceService.cs
@@ -115,10 +115,11 @@ namespace Wino.Services
private void UpdateAppCoreWindowTitle()
{
- var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
+ // TODO: WinUI
+ //var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
- if (appView != null)
- appView.Title = CoreWindowTitle;
+ //if (appView != null)
+ // appView.Title = CoreWindowTitle;
}
}
}
diff --git a/Wino.Core/Wino.Core.NET8.csproj b/Wino.Core/Wino.Core.NET8.csproj
index 5f9dd96f..4ad33ba1 100644
--- a/Wino.Core/Wino.Core.NET8.csproj
+++ b/Wino.Core/Wino.Core.NET8.csproj
@@ -13,7 +13,7 @@
-
+
@@ -30,6 +30,7 @@
+
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.WinUI/App.xaml.cs b/Wino.Mail.WinUI/App.xaml.cs
index 51503247..bee644f7 100644
--- a/Wino.Mail.WinUI/App.xaml.cs
+++ b/Wino.Mail.WinUI/App.xaml.cs
@@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
-using Wino.Core;
+using Windows.Storage;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Services;
using Wino.Core.WinUI.Services;
@@ -16,6 +16,8 @@ namespace Wino
private WindowEx m_Window;
private Frame m_ShellFrame;
+ private readonly IApplicationConfiguration _applicationFolderConfiguration;
+
public App()
{
if (WebAuthenticator.CheckOAuthRedirectionActivation()) return;
@@ -24,6 +26,7 @@ namespace Wino
Services = ConfigureServices();
+ _applicationFolderConfiguration = Services.GetService();
_logInitializer = Services.GetService();
ConfigureLogger();
@@ -31,10 +34,12 @@ namespace Wino
ConfigurePrelaunch();
ConfigureXbox();
+ // Make sure the paths are setup on app start.
+ _applicationFolderConfiguration.ApplicationDataFolderPath = ApplicationData.Current.LocalFolder.Path;
+ _applicationFolderConfiguration.PublisherSharedFolderPath = ApplicationData.Current.GetPublisherCacheFolder(ApplicationConfiguration.SharedFolderName).Path;
+
_themeService = Services.GetService();
_databaseService = Services.GetService();
- _appInitializerService = Services.GetService();
- _synchronizerFactory = Services.GetService();
_translationService = Services.GetService();
_appShellService = Services.GetService();
diff --git a/Wino.Mail.WinUI/Wino.Mail.WinUI.csproj b/Wino.Mail.WinUI/Wino.Mail.WinUI.csproj
index 339dcdcf..4ac4ae89 100644
--- a/Wino.Mail.WinUI/Wino.Mail.WinUI.csproj
+++ b/Wino.Mail.WinUI/Wino.Mail.WinUI.csproj
@@ -14,6 +14,7 @@
10.0.19041.35-preview
True
False
+ True
False
SHA256
False
@@ -107,8 +108,6 @@
-
-
@@ -199,7 +198,7 @@
-
+
diff --git a/Wino.Mail/Services/DialogService.cs b/Wino.Mail/Services/DialogService.cs
index 20e09b1b..e5f81625 100644
--- a/Wino.Mail/Services/DialogService.cs
+++ b/Wino.Mail/Services/DialogService.cs
@@ -21,6 +21,8 @@ using Wino.Dialogs;
using Wino.Helpers;
using Wino.Core.WinUI.Services;
using Wino.Messaging.Server;
+using Windows.Foundation.Metadata;
+
#if NET8_0
diff --git a/Wino.Messages/Wino.Messaging.NET8.csproj b/Wino.Messages/Wino.Messaging.NET8.csproj
new file mode 100644
index 00000000..e691aa99
--- /dev/null
+++ b/Wino.Messages/Wino.Messaging.NET8.csproj
@@ -0,0 +1,13 @@
+
+
+
+ net8.0
+ disable
+ disable
+ Wino.Messaging
+
+
+
+
+
+
diff --git a/Wino.Server.NET8/App.xaml b/Wino.Server.NET8/App.xaml
new file mode 100644
index 00000000..69096344
--- /dev/null
+++ b/Wino.Server.NET8/App.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wino.Server.NET8/App.xaml.cs b/Wino.Server.NET8/App.xaml.cs
new file mode 100644
index 00000000..0c435100
--- /dev/null
+++ b/Wino.Server.NET8/App.xaml.cs
@@ -0,0 +1,35 @@
+using H.NotifyIcon;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Input;
+
+namespace Wino.Server.NET8
+{
+ public partial class App : Application
+ {
+ public TaskbarIcon? TrayIcon { get; private set; }
+ public Window? Window { get; set; }
+
+ public bool HandleClosedEvents { get; set; } = true;
+ public App()
+ {
+ InitializeComponent();
+ }
+
+ protected override void OnLaunched(LaunchActivatedEventArgs args)
+ {
+
+ }
+
+ private void InitializeTrayIcon()
+ {
+ var showHideWindowCommand = (XamlUICommand)Resources["ShowHideWindowCommand"];
+ // showHideWindowCommand.ExecuteRequested ;
+
+ var exitApplicationCommand = (XamlUICommand)Resources["ExitApplicationCommand"];
+ //exitApplicationCommand.ExecuteRequested += ExitApplicationCommand_ExecuteRequested;
+
+ TrayIcon = (TaskbarIcon)Resources["TrayIcon"];
+ TrayIcon.ForceCreate();
+ }
+ }
+}
diff --git a/Wino.Server.NET8/Assets/LockScreenLogo.scale-200.png b/Wino.Server.NET8/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 00000000..7440f0d4
Binary files /dev/null and b/Wino.Server.NET8/Assets/LockScreenLogo.scale-200.png differ
diff --git a/Wino.Server.NET8/Assets/SplashScreen.scale-200.png b/Wino.Server.NET8/Assets/SplashScreen.scale-200.png
new file mode 100644
index 00000000..32f486a8
Binary files /dev/null and b/Wino.Server.NET8/Assets/SplashScreen.scale-200.png differ
diff --git a/Wino.Server.NET8/Assets/Square150x150Logo.scale-200.png b/Wino.Server.NET8/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 00000000..53ee3777
Binary files /dev/null and b/Wino.Server.NET8/Assets/Square150x150Logo.scale-200.png differ
diff --git a/Wino.Server.NET8/Assets/Square44x44Logo.scale-200.png b/Wino.Server.NET8/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 00000000..f713bba6
Binary files /dev/null and b/Wino.Server.NET8/Assets/Square44x44Logo.scale-200.png differ
diff --git a/Wino.Server.NET8/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Wino.Server.NET8/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 00000000..dc9f5bea
Binary files /dev/null and b/Wino.Server.NET8/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/Wino.Server.NET8/Assets/StoreLogo.png b/Wino.Server.NET8/Assets/StoreLogo.png
new file mode 100644
index 00000000..a4586f26
Binary files /dev/null and b/Wino.Server.NET8/Assets/StoreLogo.png differ
diff --git a/Wino.Server.NET8/Assets/Wide310x150Logo.scale-200.png b/Wino.Server.NET8/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 00000000..8b4a5d0d
Binary files /dev/null and b/Wino.Server.NET8/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/Wino.Server/Images/Wino_Icon.ico b/Wino.Server.NET8/Assets/Wino_Icon.ico
similarity index 100%
rename from Wino.Server/Images/Wino_Icon.ico
rename to Wino.Server.NET8/Assets/Wino_Icon.ico
diff --git a/Wino.Server.NET8/Package.appxmanifest b/Wino.Server.NET8/Package.appxmanifest
new file mode 100644
index 00000000..46572777
--- /dev/null
+++ b/Wino.Server.NET8/Package.appxmanifest
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+ Wino.Server.NET8
+ bkaan
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wino.Server.NET8/Program.cs b/Wino.Server.NET8/Program.cs
new file mode 100644
index 00000000..f7933cc0
--- /dev/null
+++ b/Wino.Server.NET8/Program.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.UI.Dispatching;
+using Microsoft.Windows.AppLifecycle;
+using Wino.Server.NET8;
+
+namespace Wino.Server
+{
+ class Program
+ {
+ private const string WinoActivationKey = nameof(WinoActivationKey);
+
+ [STAThread]
+ static void Main(string[] args)
+ {
+ WinRT.ComWrappersSupport.InitializeComWrappers();
+ bool isRedirect = DecideRedirection();
+ if (!isRedirect)
+ {
+ Microsoft.UI.Xaml.Application.Start((p) =>
+ {
+ var context = new DispatcherQueueSynchronizationContext(
+ DispatcherQueue.GetForCurrentThread());
+ SynchronizationContext.SetSynchronizationContext(context);
+ new App();
+ });
+ }
+ }
+
+ private static bool DecideRedirection()
+ {
+ bool isRedirect = false;
+
+ AppActivationArguments args = AppInstance.GetCurrent().GetActivatedEventArgs();
+ ExtendedActivationKind kind = args.Kind;
+
+ try
+ {
+ AppInstance keyInstance = AppInstance.FindOrRegisterForKey(WinoActivationKey);
+
+ if (keyInstance.IsCurrent)
+ {
+ keyInstance.Activated += OnActivated;
+ }
+ else
+ {
+ isRedirect = true;
+ RedirectActivationTo(args, keyInstance);
+ }
+ }
+
+ catch (Exception ex)
+ {
+
+ }
+
+ return isRedirect;
+ }
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ private static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName);
+
+ [DllImport("kernel32.dll")]
+ private static extern bool SetEvent(IntPtr hEvent);
+
+ [DllImport("ole32.dll")]
+ private static extern uint CoWaitForMultipleObjects(uint dwFlags, uint dwMilliseconds, ulong nHandles, IntPtr[] pHandles, out uint dwIndex);
+
+ private static IntPtr redirectEventHandle = IntPtr.Zero;
+
+ // Do the redirection on another thread, and use a non-blocking
+ // wait method to wait for the redirection to complete.
+ public static void RedirectActivationTo(
+ AppActivationArguments args, AppInstance keyInstance)
+ {
+ redirectEventHandle = CreateEvent(IntPtr.Zero, true, false, null);
+
+ Task.Run(() =>
+ {
+ keyInstance.RedirectActivationToAsync(args).AsTask().Wait();
+ SetEvent(redirectEventHandle);
+ });
+
+ uint CWMO_DEFAULT = 0;
+ uint INFINITE = 0xFFFFFFFF;
+
+ _ = CoWaitForMultipleObjects(CWMO_DEFAULT, INFINITE, 1, new IntPtr[] { redirectEventHandle }, out uint handleIndex);
+ }
+
+ private static void OnActivated(object sender, AppActivationArguments args)
+ {
+ ExtendedActivationKind kind = args.Kind;
+ }
+ }
+}
diff --git a/Wino.Server.NET8/Properties/launchSettings.json b/Wino.Server.NET8/Properties/launchSettings.json
new file mode 100644
index 00000000..9d3f5df3
--- /dev/null
+++ b/Wino.Server.NET8/Properties/launchSettings.json
@@ -0,0 +1,10 @@
+{
+ "profiles": {
+ "Wino.Server.NET8 (Package)": {
+ "commandName": "MsixPackage"
+ },
+ "Wino.Server.NET8 (Unpackaged)": {
+ "commandName": "Project"
+ }
+ }
+}
\ No newline at end of file
diff --git a/Wino.Server.NET8/TrayIconResources.xaml b/Wino.Server.NET8/TrayIconResources.xaml
new file mode 100644
index 00000000..b42183ca
--- /dev/null
+++ b/Wino.Server.NET8/TrayIconResources.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wino.Server.NET8/TrayIconResources.xaml.cs b/Wino.Server.NET8/TrayIconResources.xaml.cs
new file mode 100644
index 00000000..59014a5c
--- /dev/null
+++ b/Wino.Server.NET8/TrayIconResources.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml;
+
+namespace Wino.Server
+{
+ partial class TrayIconResources : ResourceDictionary
+ {
+ public TrayIconResources()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Wino.Server.NET8/Wino.Server.NET8.csproj b/Wino.Server.NET8/Wino.Server.NET8.csproj
new file mode 100644
index 00000000..b1ec355e
--- /dev/null
+++ b/Wino.Server.NET8/Wino.Server.NET8.csproj
@@ -0,0 +1,98 @@
+
+
+ WinExe
+ net8.0-windows10.0.19041.0
+ 10.0.17763.0
+ Wino.Server
+ app.manifest
+ x86;x64;ARM64
+ win-x86;win-x64;win-arm64
+ win10-x86;win10-x64;win10-arm64
+ win-$(Platform).pubxml
+ true
+ true
+
+
+
+
+ DISABLE_XAML_GENERATED_MAIN
+
+
+ DISABLE_XAML_GENERATED_MAIN
+
+
+ DISABLE_XAML_GENERATED_MAIN
+
+
+ DISABLE_XAML_GENERATED_MAIN
+
+
+ DISABLE_XAML_GENERATED_MAIN
+
+
+ DISABLE_XAML_GENERATED_MAIN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
+
+ MSBuild:Compile
+
+
+
+
+
+ true
+
+
\ No newline at end of file
diff --git a/Wino.Server.NET8/app.manifest b/Wino.Server.NET8/app.manifest
new file mode 100644
index 00000000..22057a5f
--- /dev/null
+++ b/Wino.Server.NET8/app.manifest
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PerMonitorV2
+
+
+
\ No newline at end of file
diff --git a/Wino.Server/App.xaml b/Wino.Server.OLD/App.xaml
similarity index 90%
rename from Wino.Server/App.xaml
rename to Wino.Server.OLD/App.xaml
index f36b711a..212bf19b 100644
--- a/Wino.Server/App.xaml
+++ b/Wino.Server.OLD/App.xaml
@@ -2,7 +2,6 @@
x:Class="Wino.Server.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- ShutdownMode="OnExplicitShutdown"
xmlns:local="clr-namespace:Wino.Server">
diff --git a/Wino.Server/App.xaml.cs b/Wino.Server.OLD/App.xaml.cs
similarity index 84%
rename from Wino.Server/App.xaml.cs
rename to Wino.Server.OLD/App.xaml.cs
index 3e9ce04f..1c214895 100644
--- a/Wino.Server/App.xaml.cs
+++ b/Wino.Server.OLD/App.xaml.cs
@@ -1,9 +1,10 @@
using System;
using System.Threading;
using System.Threading.Tasks;
-using System.Windows;
using H.NotifyIcon;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Input;
using Windows.Storage;
using Wino.Core;
using Wino.Core.Domain.Interfaces;
@@ -28,12 +29,17 @@ namespace Wino.Server
public new static App Current => (App)Application.Current;
- private TaskbarIcon? notifyIcon;
+ private TaskbarIcon notifyIcon;
private static Mutex _mutex = null;
private EventWaitHandle _eventWaitHandle;
public IServiceProvider Services { get; private set; }
+ public App()
+ {
+ InitializeComponent();
+ }
+
private IServiceProvider ConfigureServices()
{
var services = new ServiceCollection();
@@ -72,8 +78,10 @@ namespace Wino.Server
return serverViewModel;
}
- protected override async void OnStartup(StartupEventArgs e)
+ protected override void OnLaunched(LaunchActivatedEventArgs args)
{
+ base.OnLaunched(args);
+
_mutex = new Mutex(true, WinoServerAppName, out bool isCreatedNew);
_eventWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset, WinoServerActiatedName);
@@ -102,7 +110,6 @@ namespace Wino.Server
Services = ConfigureServices();
- base.OnStartup(e);
var serverViewModel = await InitializeNewServerAsync();
@@ -117,14 +124,21 @@ namespace Wino.Server
_eventWaitHandle.Set();
// Terminate this instance.
- Shutdown();
+ // Shutdown();
}
+
}
- protected override void OnExit(ExitEventArgs e)
+ private void InitializeNotifyIcon()
{
- notifyIcon?.Dispose();
- base.OnExit(e);
+ var showHideWindowCommand = (XamlUICommand)Resources["ShowHideWindowCommand"];
+ showHideWindowCommand.ExecuteRequested += ShowHideWindowCommand_ExecuteRequested;
+
+ var exitApplicationCommand = (XamlUICommand)Resources["ExitApplicationCommand"];
+ exitApplicationCommand.ExecuteRequested += ExitApplicationCommand_ExecuteRequested;
+
+ notifyIcon = (TaskbarIcon)Resources["TrayIcon"];
+ notifyIcon.ForceCreate();
}
}
}
diff --git a/Wino.Server.OLD/Images/Wino_Icon.ico b/Wino.Server.OLD/Images/Wino_Icon.ico
new file mode 100644
index 00000000..be12c893
Binary files /dev/null and b/Wino.Server.OLD/Images/Wino_Icon.ico differ
diff --git a/Wino.Server.OLD/Program.cs b/Wino.Server.OLD/Program.cs
new file mode 100644
index 00000000..59b627b0
--- /dev/null
+++ b/Wino.Server.OLD/Program.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.UI.Dispatching;
+
+namespace Wino.Server.WinUI
+{
+ [STAThread]
+ static async Task Main(string[] args)
+ {
+ WinRT.ComWrappersSupport.InitializeComWrappers();
+ bool isRedirect = await DecideRedirection();
+ if (!isRedirect)
+ {
+ Microsoft.UI.Xaml.Application.Start((p) =>
+ {
+ var context = new DispatcherQueueSynchronizationContext(
+ DispatcherQueue.GetForCurrentThread());
+ SynchronizationContext.SetSynchronizationContext(context);
+ new App();
+ });
+ }
+ return 0;
+ }
+}
diff --git a/Wino.Server/ServerContext.cs b/Wino.Server.OLD/ServerContext.cs
similarity index 100%
rename from Wino.Server/ServerContext.cs
rename to Wino.Server.OLD/ServerContext.cs
diff --git a/Wino.Server/ServerViewModel.cs b/Wino.Server.OLD/ServerViewModel.cs
similarity index 100%
rename from Wino.Server/ServerViewModel.cs
rename to Wino.Server.OLD/ServerViewModel.cs
diff --git a/Wino.Server/TrayIconResources.xaml b/Wino.Server.OLD/TrayIconResoasdurces.xaml
similarity index 100%
rename from Wino.Server/TrayIconResources.xaml
rename to Wino.Server.OLD/TrayIconResoasdurces.xaml
diff --git a/Wino.Server.OLD/TrayIconResources.xaml b/Wino.Server.OLD/TrayIconResources.xaml
new file mode 100644
index 00000000..73a6b342
--- /dev/null
+++ b/Wino.Server.OLD/TrayIconResources.xaml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wino.Server.OLD/TrayIconResources.xaml.cs b/Wino.Server.OLD/TrayIconResources.xaml.cs
new file mode 100644
index 00000000..f9caa347
--- /dev/null
+++ b/Wino.Server.OLD/TrayIconResources.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.UI.Xaml;
+
+namespace Wino.Server.WinUI
+{
+ partial class TrayIconResources : ResourceDictionary
+ {
+ public TrayIconResources()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Wino.Server.OLD/Wino.Server.NET8.csproj b/Wino.Server.OLD/Wino.Server.NET8.csproj
new file mode 100644
index 00000000..73788538
--- /dev/null
+++ b/Wino.Server.OLD/Wino.Server.NET8.csproj
@@ -0,0 +1,50 @@
+
+
+ WinExe
+ net8.0-windows10.0.22621.0
+ 10.0.17763.0
+ Wino.Server.WinUI
+ app.manifest
+ x86;x64;ARM64
+ win-x86;win-x64;win-arm64
+ win10-x86;win10-x64;win10-arm64
+ win-$(Platform).pubxml
+ true
+ true
+
+
+ Wino.Server.App
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+
+
+
\ No newline at end of file
diff --git a/Wino.Server/Wino.Server.csproj b/Wino.Server.OLD/Wino.Server.csproj
similarity index 100%
rename from Wino.Server/Wino.Server.csproj
rename to Wino.Server.OLD/Wino.Server.csproj
diff --git a/Wino.Server/AssemblyInfo.cs b/Wino.Server/AssemblyInfo.cs
deleted file mode 100644
index b0ec8275..00000000
--- a/Wino.Server/AssemblyInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Windows;
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
diff --git a/Wino.WinUI.sln b/Wino.WinUI.sln
index c1226036..1fce069d 100644
--- a/Wino.WinUI.sln
+++ b/Wino.WinUI.sln
@@ -13,7 +13,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wino.Core.WinUI", "Wino.Cor
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wino.BackgroundTasks.NET8", "Wino.BackgroundTasks\Wino.BackgroundTasks.NET8.csproj", "{2C86AF48-F7DD-4EA6-A9A6-610E69287F03}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wino.Mail.WinUI", "Wino.Mail.WinUI\Wino.Mail.WinUI.csproj", "{955936B2-112B-4756-8BC7-67FF12BF9759}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wino.Mail.WinUI", "Wino.Mail.WinUI\Wino.Mail.WinUI.csproj", "{955936B2-112B-4756-8BC7-67FF12BF9759}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wino.Messaging.NET8", "Wino.Messages\Wino.Messaging.NET8.csproj", "{88A9B1A8-BC59-4852-93D0-37A5D357ABC6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wino.Server.NET8", "Wino.Server.NET8\Wino.Server.NET8.csproj", "{A3B3BDBB-5946-4058-8038-55A97DBCFB38}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -131,6 +135,46 @@ Global
{955936B2-112B-4756-8BC7-67FF12BF9759}.Release|x86.ActiveCfg = Release|x86
{955936B2-112B-4756-8BC7-67FF12BF9759}.Release|x86.Build.0 = Release|x86
{955936B2-112B-4756-8BC7-67FF12BF9759}.Release|x86.Deploy.0 = Release|x86
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|x64.Build.0 = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Debug|x86.Build.0 = Debug|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|ARM64.Build.0 = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|x64.ActiveCfg = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|x64.Build.0 = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|x86.ActiveCfg = Release|Any CPU
+ {88A9B1A8-BC59-4852-93D0-37A5D357ABC6}.Release|x86.Build.0 = Release|Any CPU
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|Any CPU.Build.0 = Debug|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|Any CPU.Deploy.0 = Debug|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|ARM64.Build.0 = Debug|ARM64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|x64.ActiveCfg = Debug|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|x64.Build.0 = Debug|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|x64.Deploy.0 = Debug|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|x86.ActiveCfg = Debug|x86
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|x86.Build.0 = Debug|x86
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Debug|x86.Deploy.0 = Debug|x86
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|Any CPU.ActiveCfg = Release|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|Any CPU.Build.0 = Release|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|Any CPU.Deploy.0 = Release|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|ARM64.ActiveCfg = Release|ARM64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|ARM64.Build.0 = Release|ARM64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|ARM64.Deploy.0 = Release|ARM64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|x64.ActiveCfg = Release|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|x64.Build.0 = Release|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|x64.Deploy.0 = Release|x64
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|x86.ActiveCfg = Release|x86
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|x86.Build.0 = Release|x86
+ {A3B3BDBB-5946-4058-8038-55A97DBCFB38}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE