diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 25c9619..129e932 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -31,7 +31,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - name: Setup MSBuild.exe @@ -79,10 +79,10 @@ jobs: run: | cd ${{ env.Proj_Name }} #dotnet publish ShortcutsGrid.csproj /p:PublishProfile="Win System" - #copy "bin\Win System\net6.0-windows\publish\win-x64\Win System.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults + #copy "bin\Win System\net8.0-windows\publish\win-x64\Win System.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults $exes = "Win System","Win Admin","Office","Utils","Browsers","Connections","Disk Tools","Audio","Image","Video","Hardware","Virtual Machines","Programming","Games" foreach ($name in $exes){dotnet publish ShortcutsGrid.csproj /p:PublishProfile="$name"} - foreach ($name in $exes){copy "bin\$name\net6.0-windows\publish\win-x64\$name.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults} + foreach ($name in $exes){copy "bin\$name\net8.0-windows\publish\win-x64\$name.exe" ..\\${{ env.Test_Proj_Dir }}\\TestResults} # Upload artifacts in the ations section - name: Upload artifacts diff --git a/ShortcutsGrid/MainWindow.xaml.cs b/ShortcutsGrid/MainWindow.xaml.cs index 28efd59..6366363 100644 --- a/ShortcutsGrid/MainWindow.xaml.cs +++ b/ShortcutsGrid/MainWindow.xaml.cs @@ -1,9 +1,14 @@ namespace ShortcutsGrid; +using Forms.Wpf.Mls.Tools.Models; +using Forms.Wpf.Mls.Tools.Services; using Models; using Services; +using System; +using System.ComponentModel; using System.Windows; using System.Windows.Input; +using System.Windows.Threading; /// /// Interaction logic for MainWindow.xaml @@ -14,9 +19,11 @@ public MainWindow() { ///var startTimer = Stopwatch.StartNew(); ///var endTimer = Stopwatch.StartNew(); - + InitializeComponent(); + ///WaitForResponseOnClose(); + this.ContentRendered += delegate { ///startTimer.Stop(); @@ -26,7 +33,6 @@ public MainWindow() { ///endTimer.Stop(); ///var elapsedMs = endTimer.ElapsedMilliseconds; - ///AppValues.MongoShortcutsGrid.MachineAdded(); }; AppValues.MainWin = this; @@ -45,7 +51,38 @@ public MainWindow() #endregion ShowShortcuts.Load(); + } + + private void WaitForResponseOnClose() + { + var closeTime = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, 250) }; + closeTime.Tick += delegate { this.Close(); }; + RequestResponse? response = null; + var worker = new BackgroundWorker(); + worker.DoWork += async delegate + { + var requestManager = new RequestManager(); + response = await requestManager.SendRequest("", RequestMethod.GET, ""); + }; + worker.RunWorkerCompleted += delegate { this.Close(); }; + + bool started = false; + Closing += (sender, e) => + { + if (!started) + { + worker.RunWorkerAsync(); + started = true; + closeTime.Start(); + e.Cancel = true; + } + if (response == null) + { + closeTime.Stop(); + e.Cancel = true; + } + }; } } \ No newline at end of file diff --git a/ShortcutsGrid/Properties/PublishProfiles/Audio.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Audio.pubxml index 356c8dc..522027d 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Audio.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Audio.pubxml @@ -6,14 +6,14 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Audio\net6.0-windows\publish\win-x64\ + bin\Audio\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True False - Resources\audio-128.ico - Audio + Resources\audio-128.ico + Audio \ No newline at end of file diff --git a/ShortcutsGrid/Properties/PublishProfiles/Browsers.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Browsers.pubxml index d7679fe..658a332 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Browsers.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Browsers.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Browsers\net6.0-windows\publish\win-x64\ + bin\Browsers\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Connections.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Connections.pubxml index 701977a..221d9c5 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Connections.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Connections.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Connections\net6.0-windows\publish\win-x64\ + bin\Connections\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Disk Tools.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Disk Tools.pubxml index 87aac63..fad3412 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Disk Tools.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Disk Tools.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Disk Tools\net6.0-windows\publish\win-x64\ + bin\Disk Tools\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/FolderProfile.pubxml b/ShortcutsGrid/Properties/PublishProfiles/FolderProfile.pubxml index 835c5af..e767751 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/FolderProfile.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/FolderProfile.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Release\net6.0-windows\publish\win-x64\ + bin\Release\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Games.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Games.pubxml index 7e8edcc..4b44fe2 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Games.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Games.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Games\net6.0-windows\publish\win-x64\ + bin\Games\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Hardware.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Hardware.pubxml index 2830a87..d42ee66 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Hardware.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Hardware.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Hardware\net6.0-windows\publish\win-x64\ + bin\Hardware\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Image.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Image.pubxml index 39f9506..e82f29c 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Image.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Image.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Image\net6.0-windows\publish\win-x64\ + bin\Image\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Office.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Office.pubxml index 51daf1e..68cfef3 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Office.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Office.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Office\net6.0-windows\publish\win-x64\ + bin\Office\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Programming.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Programming.pubxml index 2c250f9..7b6698a 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Programming.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Programming.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Programming\net6.0-windows\publish\win-x64\ + bin\Programming\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Utils.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Utils.pubxml index e51a2ed..5a718f7 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Utils.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Utils.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Utils\net6.0-windows\publish\win-x64\ + bin\Utils\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Video.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Video.pubxml index 87ffd4d..89cb3c7 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Video.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Video.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Video\net6.0-windows\publish\win-x64\ + bin\Video\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Virtual Machines.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Virtual Machines.pubxml index b690354..9c60e9b 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Virtual Machines.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Virtual Machines.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Virtual Machines\net6.0-windows\publish\win-x64\ + bin\Virtual Machines\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Win Admin.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Win Admin.pubxml index b36defc..a137cc1 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Win Admin.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Win Admin.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Win Admin\net6.0-windows\publish\win-x64\ + bin\Win Admin\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/Properties/PublishProfiles/Win System.pubxml b/ShortcutsGrid/Properties/PublishProfiles/Win System.pubxml index e7d55e3..165f809 100644 --- a/ShortcutsGrid/Properties/PublishProfiles/Win System.pubxml +++ b/ShortcutsGrid/Properties/PublishProfiles/Win System.pubxml @@ -6,9 +6,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Win System\net6.0-windows\publish\win-x64\ + bin\Win System\net8.0-windows\publish\win-x64\ FileSystem - net6.0-windows + net8.0-windows win-x64 false True diff --git a/ShortcutsGrid/ShortcutsGrid.csproj b/ShortcutsGrid/ShortcutsGrid.csproj index 64ebfe3..d22e0f5 100644 --- a/ShortcutsGrid/ShortcutsGrid.csproj +++ b/ShortcutsGrid/ShortcutsGrid.csproj @@ -18,6 +18,7 @@ +