提升源码构建的兼容性

This commit is contained in:
muqing 2024-07-29 09:10:42 +08:00
parent 6b89071ea1
commit 11b73861b7
9 changed files with 7 additions and 58 deletions

View File

@ -1,17 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>RustTools.Core</RootNamespace>
<Platforms>AnyCPU;x64;x86</Platforms>
<Platforms>x86;x64;arm64;AnyCPU</Platforms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>
</Project>

View File

@ -5,8 +5,6 @@ using Microsoft.UI.Xaml;
using RustTools.Activation; using RustTools.Activation;
using RustTools.Contracts.Services; using RustTools.Contracts.Services;
using RustTools.Core.Contracts.Services;
using RustTools.Core.Services;
using RustTools.Helpers; using RustTools.Helpers;
using RustTools.Models; using RustTools.Models;
using RustTools.Services; using RustTools.Services;
@ -41,9 +39,9 @@ public partial class App : Application
return service; return service;
} }
public static WindowEx MainWindow { get; } = new MainWindow();
public static UIElement? AppTitlebar { get; set; } public static UIElement? AppTitlebar { get; set; }
public static WindowEx MainWindow { get; } = new MainWindow();
public App() public App()
{ {
@ -111,27 +109,4 @@ public partial class App : Application
await App.GetService<IActivationService>().ActivateAsync(args); await App.GetService<IActivationService>().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();
//};
}
} }

View File

@ -1,4 +1,4 @@
namespace RustTools.Core.Contracts.Services; namespace RustTools.Contracts.Services;
public interface IFileService public interface IFileService
{ {

View File

@ -1,6 +1,6 @@
using Newtonsoft.Json; using Newtonsoft.Json;
namespace RustTools.Core.Helpers; namespace RustTools.Helpers;
public static class Json public static class Json
{ {

View File

@ -1,4 +1,4 @@
using RustTools.Core.Helpers; using RustTools.Helpers;
using Windows.Storage; using Windows.Storage;
using Windows.Storage.Streams; using Windows.Storage.Streams;

View File

@ -44,9 +44,6 @@
<PackageReference Include="WinUIEx" Version="2.3.2" /> <PackageReference Include="WinUIEx" Version="2.3.2" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RustTools.Core\RustTools.Core.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="appsettings.json"> <None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
@ -88,8 +85,4 @@
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu> <HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Remove="Assets\image\image_24dp_E8EAED_FILL0_wght400_GRAD0_opsz24 (1).svg" />
<Content Remove="Assets\创意工坊.svg" />
</ItemGroup>
</Project> </Project>

View File

@ -2,9 +2,9 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using RustTools.Core.Contracts.Services; using RustTools.Contracts.Services;
namespace RustTools.Core.Services; namespace RustTools.Services;
public class FileService : IFileService public class FileService : IFileService
{ {

View File

@ -1,8 +1,6 @@
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using RustTools.Contracts.Services; using RustTools.Contracts.Services;
using RustTools.Core.Contracts.Services;
using RustTools.Core.Helpers;
using RustTools.Helpers; using RustTools.Helpers;
using RustTools.Models; using RustTools.Models;

View File

@ -15,7 +15,7 @@ using Microsoft.UI.Xaml.Navigation;
using RustTools.muqing; using RustTools.muqing;
using Newtonsoft.Json; using Newtonsoft.Json;
using RustTools.DataList; using RustTools.DataList;
using RustTools.Core.Helpers; using RustTools.Helpers;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
// To learn more about WinUI, the WinUI project structure, // To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info. // and more about our project templates, see: http://aka.ms/winui-project-info.