Implement NET8 server but without packaging capability.
This commit is contained in:
9
Wino.Server/App.xaml
Normal file
9
Wino.Server/App.xaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<Application
|
||||
x:Class="Wino.Server.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Wino.Server">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary Source="TrayIconResources.xaml" />
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
144
Wino.Server/App.xaml.cs
Normal file
144
Wino.Server/App.xaml.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
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;
|
||||
using Wino.Core.Services;
|
||||
using Wino.Core.UWP.Services;
|
||||
using Wino.Services;
|
||||
|
||||
namespace Wino.Server
|
||||
{
|
||||
/// <summary>
|
||||
/// Single instance Wino Server.
|
||||
/// Instancing is done using Mutex.
|
||||
/// App will not start if another instance is already running.
|
||||
/// App will let running server know that server execution is triggered, which will
|
||||
/// led server to start new connection to requesting UWP app.
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
private const string NotifyIconResourceKey = "NotifyIcon";
|
||||
private const string WinoServerAppName = "Wino.Server";
|
||||
private const string WinoServerActiatedName = "Wino.Server.Activated";
|
||||
|
||||
public new static App Current => (App)Application.Current;
|
||||
|
||||
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();
|
||||
|
||||
services.AddTransient<ServerContext>();
|
||||
services.AddTransient<ServerViewModel>();
|
||||
|
||||
services.RegisterCoreServices();
|
||||
|
||||
// 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>();
|
||||
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
|
||||
private async Task<ServerViewModel> InitializeNewServerAsync()
|
||||
{
|
||||
// TODO: Error handling.
|
||||
|
||||
var databaseService = Services.GetService<IDatabaseService>();
|
||||
var applicationFolderConfiguration = Services.GetService<IApplicationConfiguration>();
|
||||
|
||||
applicationFolderConfiguration.ApplicationDataFolderPath = ApplicationData.Current.LocalFolder.Path;
|
||||
applicationFolderConfiguration.PublisherSharedFolderPath = ApplicationData.Current.GetPublisherCacheFolder(ApplicationConfiguration.SharedFolderName).Path;
|
||||
|
||||
await databaseService.InitializeAsync();
|
||||
|
||||
var serverViewModel = Services.GetRequiredService<ServerViewModel>();
|
||||
|
||||
await serverViewModel.InitializeAsync();
|
||||
|
||||
return serverViewModel;
|
||||
}
|
||||
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||
{
|
||||
base.OnLaunched(args);
|
||||
|
||||
_mutex = new Mutex(true, WinoServerAppName, out bool isCreatedNew);
|
||||
_eventWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset, WinoServerActiatedName);
|
||||
|
||||
if (isCreatedNew)
|
||||
{
|
||||
// Spawn a thread which will be waiting for our event
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
while (_eventWaitHandle.WaitOne())
|
||||
{
|
||||
if (notifyIcon == null) return;
|
||||
|
||||
Current.Dispatcher.BeginInvoke(async () =>
|
||||
{
|
||||
if (notifyIcon.DataContext is ServerViewModel trayIconViewModel)
|
||||
{
|
||||
await trayIconViewModel.ReconnectAsync();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// It is important mark it as background otherwise it will prevent app from exiting.
|
||||
thread.IsBackground = true;
|
||||
thread.Start();
|
||||
|
||||
Services = ConfigureServices();
|
||||
|
||||
|
||||
var serverViewModel = await InitializeNewServerAsync();
|
||||
|
||||
// Create taskbar icon for the new server.
|
||||
notifyIcon = (TaskbarIcon)FindResource(NotifyIconResourceKey);
|
||||
notifyIcon.DataContext = serverViewModel;
|
||||
notifyIcon.ForceCreate(enablesEfficiencyMode: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Notify other instance so it could reconnect to UWP app if needed.
|
||||
_eventWaitHandle.Set();
|
||||
|
||||
// Terminate this instance.
|
||||
// Shutdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void InitializeNotifyIcon()
|
||||
{
|
||||
var showHideWindowCommand = (XamlUICommand)Resources["ShowHideWindowCommand"];
|
||||
showHideWindowCommand.ExecuteRequested += ShowHideWindowCommand_ExecuteRequested;
|
||||
|
||||
var exitApplicationCommand = (XamlUICommand)Resources["ExitApplicationCommand"];
|
||||
exitApplicationCommand.ExecuteRequested += ExitApplicationCommand_ExecuteRequested;
|
||||
|
||||
notifyIcon = (TaskbarIcon)Resources["TrayIcon"];
|
||||
notifyIcon.ForceCreate();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Wino.Server/Images/Wino_Icon.ico
Normal file
BIN
Wino.Server/Images/Wino_Icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 124 KiB |
25
Wino.Server/Program.cs
Normal file
25
Wino.Server/Program.cs
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
221
Wino.Server/ServerContext.cs
Normal file
221
Wino.Server/ServerContext.cs
Normal file
@@ -0,0 +1,221 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.AppService;
|
||||
using Windows.Foundation.Collections;
|
||||
using Wino.Core.Authenticators;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Synchronization;
|
||||
using Wino.Core.Integration.Processors;
|
||||
using Wino.Core.Services;
|
||||
using Wino.Core.Synchronizers;
|
||||
using Wino.Messaging;
|
||||
using Wino.Messaging.Enums;
|
||||
using Wino.Messaging.Server;
|
||||
|
||||
namespace Wino.Server
|
||||
{
|
||||
public class ServerContext :
|
||||
IRecipient<AccountCreatedMessage>,
|
||||
IRecipient<AccountUpdatedMessage>,
|
||||
IRecipient<AccountRemovedMessage>,
|
||||
IRecipient<DraftCreated>,
|
||||
IRecipient<DraftFailed>,
|
||||
IRecipient<DraftMapped>,
|
||||
IRecipient<FolderRenamed>,
|
||||
IRecipient<FolderSynchronizationEnabled>,
|
||||
IRecipient<MailAddedMessage>,
|
||||
IRecipient<MailDownloadedMessage>,
|
||||
IRecipient<MailRemovedMessage>,
|
||||
IRecipient<MailUpdatedMessage>,
|
||||
IRecipient<MergedInboxRenamed>
|
||||
{
|
||||
private static object connectionLock = new object();
|
||||
|
||||
private AppServiceConnection connection = null;
|
||||
|
||||
private readonly IDatabaseService _databaseService;
|
||||
private readonly IApplicationConfiguration _applicationFolderConfiguration;
|
||||
|
||||
public ServerContext(IDatabaseService databaseService, IApplicationConfiguration applicationFolderConfiguration)
|
||||
{
|
||||
_databaseService = databaseService;
|
||||
_applicationFolderConfiguration = applicationFolderConfiguration;
|
||||
|
||||
WeakReferenceMessenger.Default.RegisterAll(this);
|
||||
}
|
||||
|
||||
#region Message Handlers
|
||||
|
||||
public async void Receive(MailAddedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(AccountCreatedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(AccountUpdatedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(AccountRemovedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(DraftCreated message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(DraftFailed message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(DraftMapped message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(FolderRenamed message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(FolderSynchronizationEnabled message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(MailDownloadedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(MailRemovedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(MailUpdatedMessage message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
public async void Receive(MergedInboxRenamed message) => await SendMessageAsync(MessageType.UIMessage, message);
|
||||
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// Open connection to UWP app service
|
||||
/// </summary>
|
||||
public async Task InitializeAppServiceConnectionAsync()
|
||||
{
|
||||
if (connection != null) DisposeConnection();
|
||||
|
||||
connection = new AppServiceConnection
|
||||
{
|
||||
AppServiceName = "WinoInteropService",
|
||||
PackageFamilyName = GetAppPackagFamilyName()
|
||||
};
|
||||
|
||||
connection.RequestReceived += OnWinRTMessageReceived;
|
||||
connection.ServiceClosed += OnConnectionClosed;
|
||||
|
||||
AppServiceConnectionStatus status = await connection.OpenAsync();
|
||||
|
||||
if (status != AppServiceConnectionStatus.Success)
|
||||
{
|
||||
// TODO: Handle connection error
|
||||
|
||||
DisposeConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task TestOutlookSynchronizer()
|
||||
{
|
||||
var accountService = App.Current.Services.GetService<IAccountService>();
|
||||
|
||||
var accs = await accountService.GetAccountsAsync();
|
||||
var acc = accs.ElementAt(0);
|
||||
|
||||
var authenticator = App.Current.Services.GetService<OutlookAuthenticator>();
|
||||
var processor = App.Current.Services.GetService<IOutlookChangeProcessor>();
|
||||
|
||||
var sync = new OutlookSynchronizer(acc, authenticator, processor);
|
||||
|
||||
var options = new SynchronizationOptions()
|
||||
{
|
||||
AccountId = acc.Id,
|
||||
Type = Core.Domain.Enums.SynchronizationType.Full
|
||||
};
|
||||
|
||||
var result = await sync.SynchronizeAsync(options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes current connection to UWP app service.
|
||||
/// </summary>
|
||||
private void DisposeConnection()
|
||||
{
|
||||
lock (connectionLock)
|
||||
{
|
||||
if (connection == null) return;
|
||||
|
||||
connection.RequestReceived -= OnWinRTMessageReceived;
|
||||
connection.ServiceClosed -= OnConnectionClosed;
|
||||
|
||||
connection.Dispose();
|
||||
connection = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a serialized object to UWP application if connection exists with given type.
|
||||
/// </summary>
|
||||
/// <param name="messageType">Type of the message.</param>
|
||||
/// <param name="message">IServerMessage object that will be serialized.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentException">When the message is not IServerMessage.</exception>
|
||||
private async Task SendMessageAsync(MessageType messageType, object message)
|
||||
{
|
||||
if (connection == null) return;
|
||||
|
||||
if (message is not IServerMessage serverMessage)
|
||||
throw new ArgumentException("Server message must be a type of IServerMessage");
|
||||
|
||||
string json = JsonSerializer.Serialize(message);
|
||||
|
||||
var set = new ValueSet
|
||||
{
|
||||
{ MessageConstants.MessageTypeKey, (int)messageType },
|
||||
{ MessageConstants.MessageDataKey, json },
|
||||
{ MessageConstants.MessageDataTypeKey, message.GetType().Name }
|
||||
};
|
||||
|
||||
Debug.WriteLine($"S: {messageType} ({message.GetType().Name})");
|
||||
await connection.SendMessageAsync(set);
|
||||
}
|
||||
|
||||
private void OnConnectionClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)
|
||||
{
|
||||
// TODO: Handle connection closed.
|
||||
|
||||
// UWP app might've been terminated or suspended.
|
||||
// At this point, we must keep active synchronizations going, but connection is lost.
|
||||
// As long as this process is alive, database will be kept updated, but no messages will be sent.
|
||||
|
||||
DisposeConnection();
|
||||
}
|
||||
|
||||
private void OnWinRTMessageReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
|
||||
{
|
||||
// TODO: Handle incoming messages from UWP/WINUI Application.
|
||||
|
||||
}
|
||||
|
||||
#region Init
|
||||
|
||||
private string GetAppPackagFamilyName()
|
||||
{
|
||||
// If running as a standalone app, Package will throw exception.
|
||||
// Return hardcoded value for debugging purposes.
|
||||
// Connection will not be available in this case.
|
||||
|
||||
try
|
||||
{
|
||||
return Package.Current.Id.FamilyName;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return "Debug.Wino.Server.FamilyName";
|
||||
}
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
{
|
||||
|
||||
await InitializeAppServiceConnectionAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
40
Wino.Server/ServerViewModel.cs
Normal file
40
Wino.Server/ServerViewModel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Server
|
||||
{
|
||||
public partial class ServerViewModel : ObservableObject, IInitializeAsync
|
||||
{
|
||||
public ServerContext Context { get; }
|
||||
|
||||
public ServerViewModel(ServerContext serverContext)
|
||||
{
|
||||
Context = serverContext;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task LaunchWinoAsync()
|
||||
{
|
||||
await Context.TestOutlookSynchronizer();
|
||||
// ServerContext.SendTestMessageAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the application.
|
||||
/// </summary>
|
||||
[RelayCommand]
|
||||
public void ExitApplication()
|
||||
{
|
||||
// TODO: App service send message to UWP app to terminate itself.
|
||||
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
public async Task ReconnectAsync() => await Context.InitializeAppServiceConnectionAsync();
|
||||
|
||||
public Task InitializeAsync() => Context.InitializeAppServiceConnectionAsync();
|
||||
}
|
||||
}
|
||||
21
Wino.Server/TrayIconResoasdurces.xaml
Normal file
21
Wino.Server/TrayIconResoasdurces.xaml
Normal file
@@ -0,0 +1,21 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:server="clr-namespace:Wino.Server">
|
||||
|
||||
<ContextMenu x:Shared="false" x:Key="SysTrayMenu">
|
||||
<MenuItem Header="Launch Wino Mail" Command="{Binding LaunchWinoCommand}" />
|
||||
<Separator />
|
||||
<MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}" />
|
||||
</ContextMenu>
|
||||
|
||||
<tb:TaskbarIcon
|
||||
x:Key="NotifyIcon"
|
||||
IconSource="Images/Wino_Icon.ico"
|
||||
ToolTipText="Wino Mail"
|
||||
LeftClickCommand="{Binding LaunchWinoCommand}"
|
||||
NoLeftClickDelay="True"
|
||||
ContextMenu="{StaticResource SysTrayMenu}" />
|
||||
|
||||
</ResourceDictionary>
|
||||
42
Wino.Server/TrayIconResources.xaml
Normal file
42
Wino.Server/TrayIconResources.xaml
Normal file
@@ -0,0 +1,42 @@
|
||||
<ResourceDictionary
|
||||
x:Class="Wino.Server.WinUI.TrayIconResources"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:tb="using:H.NotifyIcon"
|
||||
xmlns:local="using:Wino.Server.WinUI">
|
||||
|
||||
<XamlUICommand
|
||||
x:Key="LaunchCommand"
|
||||
Label="Launch"
|
||||
Description="Activates Wino Mail window.">
|
||||
<XamlUICommand.IconSource>
|
||||
<SymbolIconSource Symbol="Accept" />
|
||||
</XamlUICommand.IconSource>
|
||||
</XamlUICommand>
|
||||
|
||||
<XamlUICommand
|
||||
x:Key="TerminateCommand"
|
||||
Label="Quit"
|
||||
Description="Close Wino Mail completely.">
|
||||
<XamlUICommand.IconSource>
|
||||
<SymbolIconSource Symbol="ClosePane" />
|
||||
</XamlUICommand.IconSource>
|
||||
</XamlUICommand>
|
||||
|
||||
<tb:TaskbarIcon
|
||||
x:Key="TrayIcon"
|
||||
Visibility="Visible"
|
||||
ToolTipText="Wino Mail"
|
||||
ContextMenuMode="SecondWindow"
|
||||
LeftClickCommand="{StaticResource LaunchCommand}"
|
||||
NoLeftClickDelay="True"
|
||||
IconSource="\Images\Wino_Icon.ico">
|
||||
<tb:TaskbarIcon.ContextFlyout>
|
||||
<MenuFlyout>
|
||||
<MenuFlyoutItem Command="{StaticResource LaunchCommand}" />
|
||||
<MenuFlyoutItem Command="{StaticResource TerminateCommand}" />
|
||||
</MenuFlyout>
|
||||
</tb:TaskbarIcon.ContextFlyout>
|
||||
</tb:TaskbarIcon>
|
||||
</ResourceDictionary>
|
||||
17
Wino.Server/TrayIconResources.xaml.cs
Normal file
17
Wino.Server/TrayIconResources.xaml.cs
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Wino.Server/Wino.Server.NET8.csproj
Normal file
50
Wino.Server/Wino.Server.NET8.csproj
Normal file
@@ -0,0 +1,50 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<RootNamespace>Wino.Server.WinUI</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<Platforms>x86;x64;ARM64</Platforms>
|
||||
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) < 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
||||
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<EnableMsixTooling>true</EnableMsixTooling>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Wino.Server.App</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Images\Wino_Icon.ico" />
|
||||
<None Remove="TrayIconResources.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Wino.Core.UWP\Services\ConfigurationService.cs" Link="Services\ConfigurationService.cs" />
|
||||
<Compile Include="..\Wino.Core.UWP\Services\NativeAppService.cs" Link="Services\NativeAppService.cs" />
|
||||
<Compile Include="..\Wino.Core.UWP\Services\NotificationBuilder.cs" Link="Services\NotificationBuilder.cs" />
|
||||
<Compile Include="..\Wino.Core.UWP\Services\PreferencesService.cs" Link="Services\PreferencesService.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Wino_Icon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.NET8.csproj" />
|
||||
<ProjectReference Include="..\Wino.Core\Wino.Core.NET8.csproj" />
|
||||
<ProjectReference Include="..\Wino.Messages\Wino.Messaging.NET8.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="TrayIconResources.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
42
Wino.Server/Wino.Server.csproj
Normal file
42
Wino.Server/Wino.Server.csproj
Normal file
@@ -0,0 +1,42 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
|
||||
<CsWinRTComponent>true</CsWinRTComponent>
|
||||
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Wino.Server.App</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Images\Wino_Icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Wino.Core.UWP\Services\ConfigurationService.cs" Link="Services\ConfigurationService.cs" />
|
||||
<Compile Include="..\Wino.Core.UWP\Services\NativeAppService.cs" Link="Services\NativeAppService.cs" />
|
||||
<Compile Include="..\Wino.Core.UWP\Services\NotificationBuilder.cs" Link="Services\NotificationBuilder.cs" />
|
||||
<Compile Include="..\Wino.Core.UWP\Services\PreferencesService.cs" Link="Services\PreferencesService.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Images\Wino_Icon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Wino.Core.Domain\Wino.Core.Domain.csproj" />
|
||||
<ProjectReference Include="..\Wino.Core\Wino.Core.csproj" />
|
||||
<ProjectReference Include="..\Wino.Messages\Wino.Messaging.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user