From 11b73861b7db71d0f5adf2d52e1f51284d621899 Mon Sep 17 00:00:00 2001 From: muqing <1966944300@qq.com> Date: Mon, 29 Jul 2024 09:10:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=BA=90=E7=A0=81=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RustTools.Core/RustTools.Core.csproj | 17 ------------ RustTools/App.xaml.cs | 27 +------------------ .../Contracts/Services/IFileService.cs | 2 +- {RustTools.Core => RustTools}/Helpers/Json.cs | 2 +- .../Helpers/SettingsStorageExtensions.cs | 2 +- RustTools/RustTools.csproj | 7 ----- .../Services/FileService.cs | 4 +-- RustTools/Services/LocalSettingsService.cs | 2 -- RustTools/WindowUI/ModulePage.xaml.cs | 2 +- 9 files changed, 7 insertions(+), 58 deletions(-) delete mode 100644 RustTools.Core/RustTools.Core.csproj rename {RustTools.Core => RustTools}/Contracts/Services/IFileService.cs (81%) rename {RustTools.Core => RustTools}/Helpers/Json.cs (93%) rename {RustTools.Core => RustTools}/Services/FileService.cs (92%) diff --git a/RustTools.Core/RustTools.Core.csproj b/RustTools.Core/RustTools.Core.csproj deleted file mode 100644 index b176693..0000000 --- a/RustTools.Core/RustTools.Core.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - net7.0 - RustTools.Core - AnyCPU;x64;x86 - x86;x64;arm64;AnyCPU - enable - - - - - - - - - - diff --git a/RustTools/App.xaml.cs b/RustTools/App.xaml.cs index 3728451..ae37fa7 100644 --- a/RustTools/App.xaml.cs +++ b/RustTools/App.xaml.cs @@ -5,8 +5,6 @@ using Microsoft.UI.Xaml; using RustTools.Activation; using RustTools.Contracts.Services; -using RustTools.Core.Contracts.Services; -using RustTools.Core.Services; using RustTools.Helpers; using RustTools.Models; using RustTools.Services; @@ -41,9 +39,9 @@ public partial class App : Application return service; } - public static WindowEx MainWindow { get; } = new MainWindow(); public static UIElement? AppTitlebar { get; set; } + public static WindowEx MainWindow { get; } = new MainWindow(); public App() { @@ -111,27 +109,4 @@ public partial class App : Application await App.GetService().ActivateAsync(args); } - - private Mutex mutex; - private void InitializeMutex() - { - // Mutex name should be unique for your application. - string mutexName = "Global\\MyWinUIAppMutex"; - bool createdNew; - - // Try to create the Mutex. If it fails, another instance is already running. - mutex = new Mutex(true, mutexName, out createdNew); - if (!createdNew) - { - // Another instance is already running. - Environment.Exit(0); // Exit the current application. - } - - // Clean up the Mutex when the application exits. - //Current.Exiting += (sender, args) => - //{ - // mutex.Close(); - // mutex.Dispose(); - //}; - } } diff --git a/RustTools.Core/Contracts/Services/IFileService.cs b/RustTools/Contracts/Services/IFileService.cs similarity index 81% rename from RustTools.Core/Contracts/Services/IFileService.cs rename to RustTools/Contracts/Services/IFileService.cs index 5a21b65..429cfda 100644 --- a/RustTools.Core/Contracts/Services/IFileService.cs +++ b/RustTools/Contracts/Services/IFileService.cs @@ -1,4 +1,4 @@ -namespace RustTools.Core.Contracts.Services; +namespace RustTools.Contracts.Services; public interface IFileService { diff --git a/RustTools.Core/Helpers/Json.cs b/RustTools/Helpers/Json.cs similarity index 93% rename from RustTools.Core/Helpers/Json.cs rename to RustTools/Helpers/Json.cs index 6b573f4..2090108 100644 --- a/RustTools.Core/Helpers/Json.cs +++ b/RustTools/Helpers/Json.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace RustTools.Core.Helpers; +namespace RustTools.Helpers; public static class Json { diff --git a/RustTools/Helpers/SettingsStorageExtensions.cs b/RustTools/Helpers/SettingsStorageExtensions.cs index c07609d..5d37f18 100644 --- a/RustTools/Helpers/SettingsStorageExtensions.cs +++ b/RustTools/Helpers/SettingsStorageExtensions.cs @@ -1,4 +1,4 @@ -using RustTools.Core.Helpers; +using RustTools.Helpers; using Windows.Storage; using Windows.Storage.Streams; diff --git a/RustTools/RustTools.csproj b/RustTools/RustTools.csproj index 5d5ce91..ebd2834 100644 --- a/RustTools/RustTools.csproj +++ b/RustTools/RustTools.csproj @@ -44,9 +44,6 @@ - - - Always @@ -88,8 +85,4 @@ true - - - - diff --git a/RustTools.Core/Services/FileService.cs b/RustTools/Services/FileService.cs similarity index 92% rename from RustTools.Core/Services/FileService.cs rename to RustTools/Services/FileService.cs index 94ff583..7c8a6b9 100644 --- a/RustTools.Core/Services/FileService.cs +++ b/RustTools/Services/FileService.cs @@ -2,9 +2,9 @@ using Newtonsoft.Json; -using RustTools.Core.Contracts.Services; +using RustTools.Contracts.Services; -namespace RustTools.Core.Services; +namespace RustTools.Services; public class FileService : IFileService { diff --git a/RustTools/Services/LocalSettingsService.cs b/RustTools/Services/LocalSettingsService.cs index 066a76f..49effd9 100644 --- a/RustTools/Services/LocalSettingsService.cs +++ b/RustTools/Services/LocalSettingsService.cs @@ -1,8 +1,6 @@ using Microsoft.Extensions.Options; using RustTools.Contracts.Services; -using RustTools.Core.Contracts.Services; -using RustTools.Core.Helpers; using RustTools.Helpers; using RustTools.Models; diff --git a/RustTools/WindowUI/ModulePage.xaml.cs b/RustTools/WindowUI/ModulePage.xaml.cs index ff8a8fb..e2e2e54 100644 --- a/RustTools/WindowUI/ModulePage.xaml.cs +++ b/RustTools/WindowUI/ModulePage.xaml.cs @@ -15,7 +15,7 @@ using Microsoft.UI.Xaml.Navigation; using RustTools.muqing; using Newtonsoft.Json; using RustTools.DataList; -using RustTools.Core.Helpers; +using RustTools.Helpers; using System.Collections.ObjectModel; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info.