Revert everything back. Mission failed.

This commit is contained in:
Burak Kaan Köse
2024-07-20 04:16:45 +02:00
parent e04c17d591
commit 2d6155ae6f
381 changed files with 3246 additions and 292 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<Application
x:Class="Wino.Server.NET8.ServerApp"
x:Class="Wino.Server.NET8.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Wino.Server.NET8"

View File

@@ -8,21 +8,21 @@ using Windows.Storage;
using Wino.Core;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Services;
//using Wino.Core.UWP.Services;
//using Wino.Services;
using Wino.Core.UWP.Services;
using Wino.Services;
namespace Wino.Server.NET8
{
public partial class ServerApp : Application
public partial class App : Application
{
public new static ServerApp Current => (ServerApp)Application.Current;
public new static App Current => (App)Application.Current;
private const string WinoServerAppName = "Wino.Server";
public TaskbarIcon TrayIcon { get; private set; }
public bool HandleClosedEvents { get; set; } = true;
public IServiceProvider Services { get; private set; }
public ServerApp()
public App()
{
InitializeComponent();
}
@@ -39,9 +39,9 @@ namespace Wino.Server.NET8
// Below services belongs to UWP.Core package and some APIs are not available for WPF.
// We register them here to avoid compilation errors.
//services.AddSingleton<IConfigurationService, ConfigurationService>();
//services.AddSingleton<INativeAppService, NativeAppService>();
//services.AddSingleton<IPreferencesService, PreferencesService>();
services.AddSingleton<IConfigurationService, ConfigurationService>();
services.AddSingleton<INativeAppService, NativeAppService>();
services.AddSingleton<IPreferencesService, PreferencesService>();
return services.BuildServiceProvider();
}

View File

@@ -24,15 +24,13 @@ namespace Wino.Server
var context = new DispatcherQueueSynchronizationContext(
DispatcherQueue.GetForCurrentThread());
SynchronizationContext.SetSynchronizationContext(context);
new ServerApp();
new App();
});
}
}
private static bool DecideRedirection()
{
return false;
bool isRedirect = false;
AppActivationArguments args = AppInstance.GetCurrent().GetActivatedEventArgs();

View File

@@ -0,0 +1,10 @@
{
"profiles": {
"Wino.Server.NET8 (Package)": {
"commandName": "MsixPackage"
},
"Wino.Server.NET8 (Unpackaged)": {
"commandName": "Project"
}
}
}

View File

@@ -108,13 +108,13 @@ namespace Wino.Server
public async Task TestOutlookSynchronizer()
{
var accountService = ServerApp.Current.Services.GetService<IAccountService>();
var accountService = App.Current.Services.GetService<IAccountService>();
var accs = await accountService.GetAccountsAsync();
var acc = accs.ElementAt(0);
var authenticator = ServerApp.Current.Services.GetService<OutlookAuthenticator>();
var processor = ServerApp.Current.Services.GetService<IOutlookChangeProcessor>();
var authenticator = App.Current.Services.GetService<OutlookAuthenticator>();
var processor = App.Current.Services.GetService<IOutlookChangeProcessor>();
var sync = new OutlookSynchronizer(acc, authenticator, processor);

View File

@@ -1,21 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>Wino.Server</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<WindowsSdkPackageVersion>10.0.22621.35-preview</WindowsSdkPackageVersion>
<SelfContained>true</SelfContained>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<SelfContained>true</SelfContained>
<EnableMsixTooling>true</EnableMsixTooling>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<DisableEmbeddedXbf>false</DisableEmbeddedXbf>
</PropertyGroup>
<!-- Disable XAML generated main to enable single activation. -->
@@ -39,15 +36,13 @@
</PropertyGroup>
<ItemGroup>
<ApplicationDefinition Include="ServerApp.xaml" SubType="Designer" />
<None Remove="app.manifest" />
<None Remove="Assets\Wino_Icon.ico" />
<None Remove="TrayIconResources.xaml" />
</ItemGroup>
<ItemGroup>
<None Remove="ServerApp.xaml" />
<Page Remove="ServerApp.xaml" />
<Page Remove="App.xaml" />
</ItemGroup>
<ItemGroup>
@@ -63,7 +58,7 @@
<ItemGroup>
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.1.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240701003-experimental2" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240627000" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
@@ -107,4 +102,4 @@
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
</Project>
</Project>