From 5eacec4c5cf4a076e42c4661479073b9aba9e9b9 Mon Sep 17 00:00:00 2001 From: Daniel Paulino Date: Tue, 23 Jan 2024 17:56:48 -0800 Subject: [PATCH 1/3] Added nuget config --- builds/release.yml | 2 ++ src/nuget.config | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/nuget.config diff --git a/builds/release.yml b/builds/release.yml index 919099d..cf32676 100644 --- a/builds/release.yml +++ b/builds/release.yml @@ -61,6 +61,8 @@ steps: - task: NuGetCommand@2 inputs: restoreSolution: '$(solution)' + nugetConfigPath: 'src/nuget.config' + feedsToUse: 'config' - task: DotNetCoreCLI@2 inputs: diff --git a/src/nuget.config b/src/nuget.config new file mode 100644 index 0000000..ca070b8 --- /dev/null +++ b/src/nuget.config @@ -0,0 +1,9 @@ + + + + + + + + + From f378575bd7d1535e1567fc7a861010e708370fcd Mon Sep 17 00:00:00 2001 From: Daniel Paulino Date: Tue, 23 Jan 2024 20:05:35 -0800 Subject: [PATCH 2/3] Initial attempt to add appservices library. Broken build --- src/Nightingale.DesktopExtension/App.config | 6 ++ .../ITestAppService.cs | 10 +++ .../Nightingale.DesktopExtension.csproj | 70 +++++++++++++++++++ src/Nightingale.DesktopExtension/Program.cs | 17 +++++ .../Properties/AssemblyInfo.cs | 36 ++++++++++ .../TestAppService.cs | 11 +++ src/Nightingale/App.xaml.cs | 10 +++ src/Nightingale/Views/MainPage2.xaml | 6 ++ src/Nightingale/Views/MainPage2.xaml.cs | 8 +++ src/Nightingale/nightingale.csproj | 6 ++ src/Package/Package.appxmanifest | 8 ++- src/Package/Package.wapproj | 1 + src/nightingale.sln | 26 ++++++- 13 files changed, 211 insertions(+), 4 deletions(-) create mode 100644 src/Nightingale.DesktopExtension/App.config create mode 100644 src/Nightingale.DesktopExtension/ITestAppService.cs create mode 100644 src/Nightingale.DesktopExtension/Nightingale.DesktopExtension.csproj create mode 100644 src/Nightingale.DesktopExtension/Program.cs create mode 100644 src/Nightingale.DesktopExtension/Properties/AssemblyInfo.cs create mode 100644 src/Nightingale.DesktopExtension/TestAppService.cs diff --git a/src/Nightingale.DesktopExtension/App.config b/src/Nightingale.DesktopExtension/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/src/Nightingale.DesktopExtension/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/Nightingale.DesktopExtension/ITestAppService.cs b/src/Nightingale.DesktopExtension/ITestAppService.cs new file mode 100644 index 0000000..21c5120 --- /dev/null +++ b/src/Nightingale.DesktopExtension/ITestAppService.cs @@ -0,0 +1,10 @@ +using CommunityToolkit.AppServices; +using System.Threading.Tasks; + +namespace Nightingale.DesktopExtension; + +[AppService("NightingaleAppService")] +public interface ITestAppService +{ + Task SumAsync(int x, int y); +} \ No newline at end of file diff --git a/src/Nightingale.DesktopExtension/Nightingale.DesktopExtension.csproj b/src/Nightingale.DesktopExtension/Nightingale.DesktopExtension.csproj new file mode 100644 index 0000000..e19fb6a --- /dev/null +++ b/src/Nightingale.DesktopExtension/Nightingale.DesktopExtension.csproj @@ -0,0 +1,70 @@ + + + + + Debug + AnyCPU + {AB9D98C3-83FD-48B2-A1ED-305064A3C3D4} + WinExe + Nightingale.DesktopExtension + Nightingale.DesktopExtension + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + 0.1.240123-build.1621 + + + 1.14.1 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + \ No newline at end of file diff --git a/src/Nightingale.DesktopExtension/Program.cs b/src/Nightingale.DesktopExtension/Program.cs new file mode 100644 index 0000000..72980c4 --- /dev/null +++ b/src/Nightingale.DesktopExtension/Program.cs @@ -0,0 +1,17 @@ +using CommunityToolkit.AppServices; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Nightingale.DesktopExtension +{ + internal class Program + { + static async Task Main(string[] args) + { + await AppServiceComponent.RunAsync(); + } + } +} diff --git a/src/Nightingale.DesktopExtension/Properties/AssemblyInfo.cs b/src/Nightingale.DesktopExtension/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a5f0634 --- /dev/null +++ b/src/Nightingale.DesktopExtension/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("Nightingale.DesktopExtension")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Nightingale.DesktopExtension")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ab9d98c3-83fd-48b2-a1ed-305064a3c3d4")] + +// 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")] diff --git a/src/Nightingale.DesktopExtension/TestAppService.cs b/src/Nightingale.DesktopExtension/TestAppService.cs new file mode 100644 index 0000000..d41d299 --- /dev/null +++ b/src/Nightingale.DesktopExtension/TestAppService.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace Nightingale.DesktopExtension; + +public sealed partial class TestAppService : ITestAppService +{ + public async Task SumAsync(int x, int y) + { + return x + y; + } +} diff --git a/src/Nightingale/App.xaml.cs b/src/Nightingale/App.xaml.cs index e3e27fe..ee284d2 100644 --- a/src/Nightingale/App.xaml.cs +++ b/src/Nightingale/App.xaml.cs @@ -20,6 +20,7 @@ using Nightingale.Views; using Autofac; using Nightingale.Core.Services; +using Nightingale.DesktopExtension; namespace Nightingale { @@ -28,6 +29,8 @@ namespace Nightingale /// sealed partial class App : Application { + public static TestAppService TestAppService { get; private set; } = new(); + public static IContainer Container { get; private set; } public static Frame RootFrame { get; set; } @@ -42,6 +45,13 @@ public App() ThemeController.ThemeChanged += ThemeController_ThemeChanged; } + protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args) + { + base.OnBackgroundActivated(args); + + TestAppService.OnBackgroundActivated(args); + } + private void ThemeController_ThemeChanged(object sender, EventArgs e) { if (Window.Current.Content is Frame rootFrame) diff --git a/src/Nightingale/Views/MainPage2.xaml b/src/Nightingale/Views/MainPage2.xaml index 4838612..b8cd150 100644 --- a/src/Nightingale/Views/MainPage2.xaml +++ b/src/Nightingale/Views/MainPage2.xaml @@ -415,5 +415,11 @@ x:Load="{x:Bind ViewModel.Loading, Mode=OneWay}" IsActive="true" Style="{StaticResource LargeProgressRing}" /> + +