diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index a569bff2d..6b3b1426b 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -42,7 +42,7 @@ jobs: cd PCL2CEHelp rm -f ./* || true zip -r Help.zip . -x "./.*/*" - cp -f Help.zip "${{ github.workspace }}/Plain Craft Launcher 2/Resources/Help.zip" + cp -f Help.zip "${{ github.workspace }}/PCL.CE/Resources/Help.zip" cd .. rm -rf PCL2CEHelp cd "${{ github.workspace }}" @@ -59,7 +59,7 @@ jobs: PCL_LOBBY_DEFAULT_SECRET: ${{ secrets.LOBBY_DEFAULT_SECRET }} PCL_GITHUB_SHA: ${{ github.sha }} run: | - dotnet publish "Plain Craft Launcher 2/Plain Craft Launcher 2.csproj" \ + dotnet publish "PCL.CE/PCL.CE.csproj" \ -p:Configuration=${{ inputs.configuration }} -p:Platform=${{ inputs.architecture }} \ -p:DeleteExistingFiles=true -o ./artifact --no-self-contained diff --git a/PCL.Core.SourceGenerators/ConfigGenerator.cs b/PCL.CE.SourceGenerators/ConfigGenerator.cs similarity index 97% rename from PCL.Core.SourceGenerators/ConfigGenerator.cs rename to PCL.CE.SourceGenerators/ConfigGenerator.cs index 7466768c8..e9c9d2bd5 100644 --- a/PCL.Core.SourceGenerators/ConfigGenerator.cs +++ b/PCL.CE.SourceGenerators/ConfigGenerator.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; [Generator(LanguageNames.CSharp)] public sealed class ConfigGenerator : IIncrementalGenerator @@ -103,8 +103,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context) if (symbol == null) return null; var compilation = ctx.SemanticModel.Compilation; - var attrDefItem = compilation.GetTypeByMetadataName("PCL.Core.App.Configuration.ConfigItemAttribute`1"); - var attrDefAny = compilation.GetTypeByMetadataName("PCL.Core.App.Configuration.AnyConfigItemAttribute`1"); + var attrDefItem = compilation.GetTypeByMetadataName("PCL.CE.Core.App.Configuration.ConfigItemAttribute`1"); + var attrDefAny = compilation.GetTypeByMetadataName("PCL.CE.Core.App.Configuration.AnyConfigItemAttribute`1"); if (attrDefItem == null && attrDefAny == null) return null; AttributeData? picked = null; @@ -183,7 +183,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) if (symbol == null) return null; var compilation = ctx.SemanticModel.Compilation; - var attrDef = compilation.GetTypeByMetadataName("PCL.Core.App.Configuration.ConfigGroupAttribute"); + var attrDef = compilation.GetTypeByMetadataName("PCL.CE.Core.App.Configuration.ConfigGroupAttribute"); if (attrDef == null) return null; var attr = symbol.GetAttributes().FirstOrDefault(a => @@ -225,7 +225,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) // 精确匹配 [RegisterConfigEvent] var compilation = ctx.SemanticModel.Compilation; - var attrDef = compilation.GetTypeByMetadataName("PCL.Core.App.Configuration.RegisterConfigEventAttribute"); + var attrDef = compilation.GetTypeByMetadataName("PCL.CE.Core.App.Configuration.RegisterConfigEventAttribute"); if (attrDef is null) return null; var hasAttr = symbol.GetAttributes().Any(a => a.AttributeClass is not null && @@ -249,7 +249,7 @@ a.AttributeClass is not null && // 绕过 [ConfigGroup] var compilation = ctx.SemanticModel.Compilation; - var attrDef = compilation.GetTypeByMetadataName("PCL.Core.App.Configuration.ConfigGroupAttribute"); + var attrDef = compilation.GetTypeByMetadataName("PCL.CE.Core.App.Configuration.ConfigGroupAttribute"); if (attrDef is not null) { var hasAttr = symbol.GetAttributes().Any(a => @@ -350,7 +350,7 @@ private static string _GenerateAdditionalSource(ConfigTree tree) sb.AppendLine(); sb.AppendLine("using System.Collections.Generic;"); sb.AppendLine("using System.Linq;"); - sb.AppendLine("using PCL.Core.App.Configuration;"); + sb.AppendLine("using PCL.CE.Core.App.Configuration;"); sb.AppendLine(); sb.AppendLine("#nullable enable"); sb.AppendLine(); @@ -409,7 +409,7 @@ string ResolveSource(ItemModel item) => sb.AppendLine("// "); sb.AppendLine("// 此文件由 Source Generator 自动生成,请勿手动修改"); sb.AppendLine(); - sb.AppendLine("namespace PCL.Core.App.Configuration;"); + sb.AppendLine("namespace PCL.CE.Core.App.Configuration;"); sb.AppendLine(); sb.AppendLine("public sealed partial class ConfigService"); sb.AppendLine("{"); @@ -686,7 +686,7 @@ private static void _EmitGroupInto( public static string _RenderSourceCode(SemanticModel sm, ExpressionSyntax expr) { var sym = sm.GetSymbolInfo(expr).Symbol; - if (sym is IFieldSymbol fs && fs.ContainingType?.ToDisplayString() == "PCL.Core.App.Configuration.ConfigSource") + if (sym is IFieldSymbol fs && fs.ContainingType?.ToDisplayString() == "PCL.CE.Core.App.Configuration.ConfigSource") { return "ConfigSource." + fs.Name; } diff --git a/PCL.Core.SourceGenerators/DependencyCollectorGenerator.cs b/PCL.CE.SourceGenerators/DependencyCollectorGenerator.cs similarity index 98% rename from PCL.Core.SourceGenerators/DependencyCollectorGenerator.cs rename to PCL.CE.SourceGenerators/DependencyCollectorGenerator.cs index 7504a040f..f08074017 100644 --- a/PCL.Core.SourceGenerators/DependencyCollectorGenerator.cs +++ b/PCL.CE.SourceGenerators/DependencyCollectorGenerator.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; public readonly record struct CollectorInfo( INamedTypeSymbol CollectorAttrSymbol, @@ -184,7 +184,7 @@ private static void _GenerateDependencyGroup(SourceProductionContext spc, Immuta sb.AppendLine("using System.Collections.Generic;"); sb.AppendLine("using System.Collections.Immutable;"); sb.AppendLine(); - sb.AppendLine("namespace PCL.Core.App.IoC;"); + sb.AppendLine("namespace PCL.CE.Core.App.IoC;"); sb.AppendLine(); sb.AppendLine("#nullable enable"); sb.AppendLine(); @@ -301,7 +301,7 @@ private static void _GenerateDependencyInjectionMethods(SourceProductionContext var targetMethodName = targetMethod.Name; var isStatic = targetMethod.IsStatic; var isAwaitable = targetMethod.IsAwaitable(); - sb.Append(indentStr).AppendLine("[global::System.CodeDom.Compiler.GeneratedCode(\"PCL.Core.SourceGenerators.DependencyCollectorGenerator\", \"1.0.0.0\")]"); + sb.Append(indentStr).AppendLine("[global::System.CodeDom.Compiler.GeneratedCode(\"PCL.CE.SourceGenerators.DependencyCollectorGenerator\", \"1.0.0.0\")]"); sb.Append(indentStr).AppendLine("[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]"); var idCode = match.Info.Identifier.SnakeIdToPascal(); sb.Append(indentStr).Append("private "); diff --git a/PCL.Core.SourceGenerators/EnvironmentInteropGenerator.cs b/PCL.CE.SourceGenerators/EnvironmentInteropGenerator.cs similarity index 96% rename from PCL.Core.SourceGenerators/EnvironmentInteropGenerator.cs rename to PCL.CE.SourceGenerators/EnvironmentInteropGenerator.cs index d5e04ca15..3df88131f 100644 --- a/PCL.Core.SourceGenerators/EnvironmentInteropGenerator.cs +++ b/PCL.CE.SourceGenerators/EnvironmentInteropGenerator.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; [Generator(LanguageNames.CSharp)] public class EnvironmentInteropGenerator : IIncrementalGenerator @@ -46,7 +46,7 @@ private static void _Execute(SourceProductionContext context, IEnumerable<(strin sb.AppendLine(); sb.AppendLine("#nullable enable"); sb.AppendLine(); - sb.AppendLine("namespace PCL.Core.Utils.OS;"); + sb.AppendLine("namespace PCL.CE.Core.Utils.OS;"); sb.AppendLine(); sb.AppendLine("partial class EnvironmentInterop"); sb.AppendLine("{"); diff --git a/PCL.Core.SourceGenerators/LifecycleScopeGenerator.cs b/PCL.CE.SourceGenerators/LifecycleScopeGenerator.cs similarity index 99% rename from PCL.Core.SourceGenerators/LifecycleScopeGenerator.cs rename to PCL.CE.SourceGenerators/LifecycleScopeGenerator.cs index 0abdcfb5a..6b2022926 100644 --- a/PCL.Core.SourceGenerators/LifecycleScopeGenerator.cs +++ b/PCL.CE.SourceGenerators/LifecycleScopeGenerator.cs @@ -6,7 +6,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; [Generator(LanguageNames.CSharp)] public class LifecycleScopeGenerator : IIncrementalGenerator @@ -129,7 +129,7 @@ private static void _CollectSources(SourceProductionContext spc, ImmutableArray< var paraArray = method.Parameters; var skip = 0; var hasCommandModelArg = paraArray.Length > 0 - && paraArray[0].Type.GetSimplifiedTypeName() == "PCL.Core.App.Cli.CommandLine"; + && paraArray[0].Type.GetSimplifiedTypeName() == "PCL.CE.Core.App.Cli.CommandLine"; if (hasCommandModelArg) skip++; var hasIsCallbackArgIndex = hasCommandModelArg ? 1 : 0; var hasIsCallbackArg = paraArray.Length > hasIsCallbackArgIndex diff --git a/PCL.Core.SourceGenerators/LifecycleServiceTypesGenerator.cs b/PCL.CE.SourceGenerators/LifecycleServiceTypesGenerator.cs similarity index 99% rename from PCL.Core.SourceGenerators/LifecycleServiceTypesGenerator.cs rename to PCL.CE.SourceGenerators/LifecycleServiceTypesGenerator.cs index e31eff85b..db2bfdd53 100644 --- a/PCL.Core.SourceGenerators/LifecycleServiceTypesGenerator.cs +++ b/PCL.CE.SourceGenerators/LifecycleServiceTypesGenerator.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; [Generator(LanguageNames.CSharp)] public class LifecycleServiceTypesGenerator : IIncrementalGenerator @@ -208,7 +208,7 @@ private static void _Execute(SourceProductionContext context, List valid sb.AppendLine(); sb.AppendLine("using System;"); sb.AppendLine(); - sb.AppendLine("namespace PCL.Core.App.IoC;"); + sb.AppendLine("namespace PCL.CE.Core.App.IoC;"); sb.AppendLine(); sb.AppendLine("/// "); sb.AppendLine("/// 包含所有使用 LifecycleService 注解的类型,按 StartState 分类并按 Priority 降序排序"); diff --git a/PCL.Core.SourceGenerators/PCL.Core.SourceGenerators.csproj b/PCL.CE.SourceGenerators/PCL.CE.SourceGenerators.csproj similarity index 100% rename from PCL.Core.SourceGenerators/PCL.Core.SourceGenerators.csproj rename to PCL.CE.SourceGenerators/PCL.CE.SourceGenerators.csproj diff --git a/PCL.Core.SourceGenerators/SharedConstants.cs b/PCL.CE.SourceGenerators/SharedConstants.cs similarity index 89% rename from PCL.Core.SourceGenerators/SharedConstants.cs rename to PCL.CE.SourceGenerators/SharedConstants.cs index b9b440085..50304d514 100644 --- a/PCL.Core.SourceGenerators/SharedConstants.cs +++ b/PCL.CE.SourceGenerators/SharedConstants.cs @@ -1,8 +1,8 @@ -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; public static class SharedConstants { - public const string AppNamespace = "PCL.Core.App"; + public const string AppNamespace = "PCL.CE.Core.App"; public const string IocNamespace = $"{AppNamespace}.IoC"; public const string DependencyCollectorAttribute = $"{IocNamespace}.DependencyCollectorAttribute"; public const string DependencyInjectionPointAttribute = $"{IocNamespace}.DependencyInjectionPointAttribute"; diff --git a/PCL.Core.SourceGenerators/SharedExtensions.cs b/PCL.CE.SourceGenerators/SharedExtensions.cs similarity index 97% rename from PCL.Core.SourceGenerators/SharedExtensions.cs rename to PCL.CE.SourceGenerators/SharedExtensions.cs index 19abaf5f3..2cc0a439f 100644 --- a/PCL.Core.SourceGenerators/SharedExtensions.cs +++ b/PCL.CE.SourceGenerators/SharedExtensions.cs @@ -5,7 +5,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace PCL.Core.SourceGenerators; +namespace PCL.CE.SourceGenerators; public static class SharedExtensions { @@ -226,11 +226,11 @@ public static bool IsAwaitable(this IMethodSymbol method) public static string CorrectConfigTypeName(this string typeName, out string? fullTypeName) { - var isArgConfig = typeName.StartsWith("PCL.Core.App.Configuration.ArgConfig<"); + var isArgConfig = typeName.StartsWith("PCL.CE.Core.App.Configuration.ArgConfig<"); if (isArgConfig) { fullTypeName = typeName; - typeName = typeName.Substring(37, typeName.Length - 38); + typeName = typeName.Substring(40, typeName.Length - 41); } else fullTypeName = null; return typeName; diff --git a/PCL.Core.SourceGenerators/System.Runtime.CompilerServices.cs b/PCL.CE.SourceGenerators/System.Runtime.CompilerServices.cs similarity index 100% rename from PCL.Core.SourceGenerators/System.Runtime.CompilerServices.cs rename to PCL.CE.SourceGenerators/System.Runtime.CompilerServices.cs diff --git a/PCL.Core.Test/App/CommandLineTest.cs b/PCL.CE.Test/App/CommandLineTest.cs similarity index 96% rename from PCL.Core.Test/App/CommandLineTest.cs rename to PCL.CE.Test/App/CommandLineTest.cs index 2ad94c7bd..53f84afc0 100644 --- a/PCL.Core.Test/App/CommandLineTest.cs +++ b/PCL.CE.Test/App/CommandLineTest.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Text.Json; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.App.Cli; +using PCL.CE.Core.App.Cli; -namespace PCL.Core.Test.App; +namespace PCL.CE.Test.App; [TestClass] public sealed class CommandLineTest diff --git a/PCL.Core.Test/BaseXTest.cs b/PCL.CE.Test/BaseXTest.cs similarity index 93% rename from PCL.Core.Test/BaseXTest.cs rename to PCL.CE.Test/BaseXTest.cs index 141036b39..e2eabbb9e 100644 --- a/PCL.Core.Test/BaseXTest.cs +++ b/PCL.CE.Test/BaseXTest.cs @@ -1,8 +1,8 @@ using System; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class BaseXTest diff --git a/PCL.Core.Test/BlurPerformanceTest.cs b/PCL.CE.Test/BlurPerformanceTest.cs similarity index 98% rename from PCL.Core.Test/BlurPerformanceTest.cs rename to PCL.CE.Test/BlurPerformanceTest.cs index b2188054c..9248a7d4e 100644 --- a/PCL.Core.Test/BlurPerformanceTest.cs +++ b/PCL.CE.Test/BlurPerformanceTest.cs @@ -7,9 +7,9 @@ using System.Windows.Media.Effects; using System.Windows.Media.Imaging; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.UI.Effects; +using PCL.CE.Core.UI.Effects; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class BlurTest @@ -288,7 +288,7 @@ public static class PerformanceTestExamples /// public static void RunAllTests() { - Console.WriteLine("PCL.Core BlurEffect 性能优化测试套件\n"); + Console.WriteLine("PCL.CE.Core BlurEffect 性能优化测试套件\n"); // 快速对比测试 BlurPerformanceTest.QuickPerformanceComparison(); diff --git a/PCL.Core.Test/ByteHelperTest.cs b/PCL.CE.Test/ByteHelperTest.cs similarity index 94% rename from PCL.Core.Test/ByteHelperTest.cs rename to PCL.CE.Test/ByteHelperTest.cs index 40352e1ae..31ed24535 100644 --- a/PCL.Core.Test/ByteHelperTest.cs +++ b/PCL.CE.Test/ByteHelperTest.cs @@ -2,9 +2,9 @@ using System.Diagnostics; using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.IO; +using PCL.CE.Core.IO; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class ByteHelperTest diff --git a/PCL.Core.Test/DiffTest.cs b/PCL.CE.Test/DiffTest.cs similarity index 97% rename from PCL.Core.Test/DiffTest.cs rename to PCL.CE.Test/DiffTest.cs index 2ba5e8300..fa8303287 100644 --- a/PCL.Core.Test/DiffTest.cs +++ b/PCL.CE.Test/DiffTest.cs @@ -2,9 +2,9 @@ using System.IO; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Diff; +using PCL.CE.Core.Utils.Diff; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class DiffTest diff --git a/PCL.Core.Test/DynamicJsonTest.cs b/PCL.CE.Test/DynamicJsonTest.cs similarity index 94% rename from PCL.Core.Test/DynamicJsonTest.cs rename to PCL.CE.Test/DynamicJsonTest.cs index 32e0874c5..f0a376a17 100644 --- a/PCL.Core.Test/DynamicJsonTest.cs +++ b/PCL.CE.Test/DynamicJsonTest.cs @@ -2,9 +2,9 @@ using System.Dynamic; using System.Text.Json; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.Test +namespace PCL.CE.Test { [TestClass] public class DynamicJsonTest diff --git a/PCL.Core.Test/EncodingDetectorTest.cs b/PCL.CE.Test/EncodingDetectorTest.cs similarity index 94% rename from PCL.Core.Test/EncodingDetectorTest.cs rename to PCL.CE.Test/EncodingDetectorTest.cs index 67c4b8e26..037a5a985 100644 --- a/PCL.Core.Test/EncodingDetectorTest.cs +++ b/PCL.CE.Test/EncodingDetectorTest.cs @@ -1,8 +1,8 @@ using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Codecs; +using PCL.CE.Core.Utils.Codecs; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class EncodingDetectorTest { diff --git a/PCL.Core.Test/Encryption/AesGcmTest.cs b/PCL.CE.Test/Encryption/AesGcmTest.cs similarity index 95% rename from PCL.Core.Test/Encryption/AesGcmTest.cs rename to PCL.CE.Test/Encryption/AesGcmTest.cs index 01f82ab91..84f091678 100644 --- a/PCL.Core.Test/Encryption/AesGcmTest.cs +++ b/PCL.CE.Test/Encryption/AesGcmTest.cs @@ -2,7 +2,7 @@ using System.Security.Cryptography; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace PCL.Core.Test.Encryption; +namespace PCL.CE.Test.Encryption; [TestClass] public class AesGcmTest diff --git a/PCL.Core.Test/Encryption/ChaCha20.cs b/PCL.CE.Test/Encryption/ChaCha20.cs similarity index 95% rename from PCL.Core.Test/Encryption/ChaCha20.cs rename to PCL.CE.Test/Encryption/ChaCha20.cs index 6b33bd5b7..f1ae24811 100644 --- a/PCL.Core.Test/Encryption/ChaCha20.cs +++ b/PCL.CE.Test/Encryption/ChaCha20.cs @@ -2,7 +2,7 @@ using System.Security.Cryptography; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace PCL.Core.Test.Encryption; +namespace PCL.CE.Test.Encryption; [TestClass] public class ChaCha20 diff --git a/PCL.Core.Test/Encryption/ChaCha20Poly1305.cs b/PCL.CE.Test/Encryption/ChaCha20Poly1305.cs similarity index 95% rename from PCL.Core.Test/Encryption/ChaCha20Poly1305.cs rename to PCL.CE.Test/Encryption/ChaCha20Poly1305.cs index 53145e178..d6000ea4a 100644 --- a/PCL.Core.Test/Encryption/ChaCha20Poly1305.cs +++ b/PCL.CE.Test/Encryption/ChaCha20Poly1305.cs @@ -2,7 +2,7 @@ using System.Security.Cryptography; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace PCL.Core.Test.Encryption; +namespace PCL.CE.Test.Encryption; [TestClass] public class ChaCha20Poly1305 diff --git a/PCL.Core.Test/JavaTest.cs b/PCL.CE.Test/JavaTest.cs similarity index 92% rename from PCL.Core.Test/JavaTest.cs rename to PCL.CE.Test/JavaTest.cs index d0e14f3bc..cef413285 100644 --- a/PCL.Core.Test/JavaTest.cs +++ b/PCL.CE.Test/JavaTest.cs @@ -1,12 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Minecraft; -using PCL.Core.Minecraft.Java.Parser; -using PCL.Core.Minecraft.Java.Scanner; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.Minecraft.Java.Parser; +using PCL.CE.Core.Minecraft.Java.Scanner; using System; using System.Linq; using System.Threading.Tasks; -namespace PCL.Core.Test +namespace PCL.CE.Test { [TestClass] public class JavaTest diff --git a/PCL.Core.Test/LobbyCodeGenerateTest.cs b/PCL.CE.Test/LobbyCodeGenerateTest.cs similarity index 89% rename from PCL.Core.Test/LobbyCodeGenerateTest.cs rename to PCL.CE.Test/LobbyCodeGenerateTest.cs index 143ba4e6a..5775bb2d1 100644 --- a/PCL.Core.Test/LobbyCodeGenerateTest.cs +++ b/PCL.CE.Test/LobbyCodeGenerateTest.cs @@ -1,8 +1,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Link.Scaffolding; +using PCL.CE.Core.Link.Scaffolding; using System; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class LobbyCodeGenerateTest diff --git a/PCL.Core.Test/LoggerTest.cs b/PCL.CE.Test/LoggerTest.cs similarity index 95% rename from PCL.Core.Test/LoggerTest.cs rename to PCL.CE.Test/LoggerTest.cs index 0245a3355..d0bb2ca25 100644 --- a/PCL.Core.Test/LoggerTest.cs +++ b/PCL.CE.Test/LoggerTest.cs @@ -2,9 +2,9 @@ using System.IO; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class LoggerTest diff --git a/PCL.Core.Test/MavenTest.cs b/PCL.CE.Test/MavenTest.cs similarity index 94% rename from PCL.Core.Test/MavenTest.cs rename to PCL.CE.Test/MavenTest.cs index 28beab66b..e7409653c 100644 --- a/PCL.Core.Test/MavenTest.cs +++ b/PCL.CE.Test/MavenTest.cs @@ -1,40 +1,40 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Minecraft; - -[TestClass] -public class MavenTest -{ - [TestMethod] - public void ParsePathAndUri() - { - string[] mavenId = ["io.github.copytiao:pclce:0.6.2","io.github.copytiao:pclce:jar:0.6.2", - "io.github.copytiao:pclce:snapshot:0.6.2", - "io.github.copytiao:pclce:jar:snapshot:0.6.2"]; - foreach(var id in mavenId) - { - var maven = new MavenArtifact(id); - Console.WriteLine($"Uri: {maven.Resolve("https://copytiao.github.io/maven/copytiao/")}"); - Console.WriteLine($"Path: {maven.Resolve("C:/Users/copytiao/AppData/Roaming/.minecraft/library/maven")}"); - } - } - [TestMethod] - public void ParseInvalidId() - { - string[] badIds = [ - "io", - "io.github.copytiao:luotianyi:yuezhengling:xinchen:pclce:tests:aaa" - ]; - foreach(var id in badIds) - { - try - { - var package = new MavenArtifact(id); - package.Resolve(""); - }catch(FormatException ex) - { - Console.WriteLine($"Debug Output: {Environment.NewLine}{ex}"); - } - } - } +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PCL.CE.Core.Minecraft; + +[TestClass] +public class MavenTest +{ + [TestMethod] + public void ParsePathAndUri() + { + string[] mavenId = ["io.github.copytiao:pclce:0.6.2","io.github.copytiao:pclce:jar:0.6.2", + "io.github.copytiao:pclce:snapshot:0.6.2", + "io.github.copytiao:pclce:jar:snapshot:0.6.2"]; + foreach(var id in mavenId) + { + var maven = new MavenArtifact(id); + Console.WriteLine($"Uri: {maven.Resolve("https://copytiao.github.io/maven/copytiao/")}"); + Console.WriteLine($"Path: {maven.Resolve("C:/Users/copytiao/AppData/Roaming/.minecraft/library/maven")}"); + } + } + [TestMethod] + public void ParseInvalidId() + { + string[] badIds = [ + "io", + "io.github.copytiao:luotianyi:yuezhengling:xinchen:pclce:tests:aaa" + ]; + foreach(var id in badIds) + { + try + { + var package = new MavenArtifact(id); + package.Resolve(""); + }catch(FormatException ex) + { + Console.WriteLine($"Debug Output: {Environment.NewLine}{ex}"); + } + } + } } \ No newline at end of file diff --git a/PCL.Core.Test/Minecraft/McPing.cs b/PCL.CE.Test/Minecraft/McPing.cs similarity index 92% rename from PCL.Core.Test/Minecraft/McPing.cs rename to PCL.CE.Test/Minecraft/McPing.cs index 0621c3ec7..5b07918ae 100644 --- a/PCL.Core.Test/Minecraft/McPing.cs +++ b/PCL.CE.Test/Minecraft/McPing.cs @@ -2,9 +2,9 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading.Tasks; using System.Net.Sockets; -using PCL.Core.Link.McPing; +using PCL.CE.Core.Link.McPing; -namespace PCL.Core.Test.Minecraft; +namespace PCL.CE.Test.Minecraft; [TestClass] public class McPingTest diff --git a/PCL.Core.Test/Network/DoHQueryTest.cs b/PCL.CE.Test/Network/DoHQueryTest.cs similarity index 95% rename from PCL.Core.Test/Network/DoHQueryTest.cs rename to PCL.CE.Test/Network/DoHQueryTest.cs index bd76537d4..db83d487a 100644 --- a/PCL.Core.Test/Network/DoHQueryTest.cs +++ b/PCL.CE.Test/Network/DoHQueryTest.cs @@ -6,9 +6,9 @@ using Ae.Dns.Protocol.Enums; using Ae.Dns.Protocol.Records; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.IO.Net.Dns; +using PCL.CE.Core.IO.Net.Dns; -namespace PCL.Core.Test.Network; +namespace PCL.CE.Test.Network; [TestClass] public class DoHQueryTest diff --git a/PCL.Core.Test/Network/DohConnection.cs b/PCL.CE.Test/Network/DohConnection.cs similarity index 93% rename from PCL.Core.Test/Network/DohConnection.cs rename to PCL.CE.Test/Network/DohConnection.cs index 2a339bc6a..4186eee02 100644 --- a/PCL.Core.Test/Network/DohConnection.cs +++ b/PCL.CE.Test/Network/DohConnection.cs @@ -3,9 +3,9 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.IO.Net.Http.Client; +using PCL.CE.Core.IO.Net.Http.Client; -namespace PCL.Core.Test.Network; +namespace PCL.CE.Test.Network; [TestClass] public class DohConnection diff --git a/PCL.Core.Test/Network/WebServerTest.cs b/PCL.CE.Test/Network/WebServerTest.cs similarity index 97% rename from PCL.Core.Test/Network/WebServerTest.cs rename to PCL.CE.Test/Network/WebServerTest.cs index 2091c0481..9ad666a00 100644 --- a/PCL.Core.Test/Network/WebServerTest.cs +++ b/PCL.CE.Test/Network/WebServerTest.cs @@ -3,9 +3,9 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.IO.Net.Http; +using PCL.CE.Core.IO.Net.Http; -namespace PCL.Core.Test.Network; +namespace PCL.CE.Test.Network; [TestClass] public class WebServerTest diff --git a/PCL.Core.Test/PCL.Core.Test.csproj b/PCL.CE.Test/PCL.CE.Test.csproj similarity index 96% rename from PCL.Core.Test/PCL.Core.Test.csproj rename to PCL.CE.Test/PCL.CE.Test.csproj index bdb42018e..22dc0c029 100644 --- a/PCL.Core.Test/PCL.Core.Test.csproj +++ b/PCL.CE.Test/PCL.CE.Test.csproj @@ -48,9 +48,6 @@ - - - diff --git a/PCL.Core.Test/Project/Modrinth.cs b/PCL.CE.Test/Project/Modrinth.cs similarity index 96% rename from PCL.Core.Test/Project/Modrinth.cs rename to PCL.CE.Test/Project/Modrinth.cs index c28f15217..2eb4e76a2 100644 --- a/PCL.Core.Test/Project/Modrinth.cs +++ b/PCL.CE.Test/Project/Modrinth.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading.Tasks; -namespace PCL.Core.Test.Project; +namespace PCL.CE.Test.Project; [TestClass] public class Modrinth diff --git a/PCL.Core.Test/Properties/AssemblyInfo.cs b/PCL.CE.Test/Properties/AssemblyInfo.cs similarity index 100% rename from PCL.Core.Test/Properties/AssemblyInfo.cs rename to PCL.CE.Test/Properties/AssemblyInfo.cs diff --git a/PCL.Core.Test/SemVerTest.cs b/PCL.CE.Test/SemVerTest.cs similarity index 97% rename from PCL.Core.Test/SemVerTest.cs rename to PCL.CE.Test/SemVerTest.cs index 16f62cb60..c1608bfd8 100644 --- a/PCL.Core.Test/SemVerTest.cs +++ b/PCL.CE.Test/SemVerTest.cs @@ -1,8 +1,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.Test +namespace PCL.CE.Test { [TestClass] public class SemVerTest diff --git a/PCL.Core.Test/SnapLiteTest.cs b/PCL.CE.Test/SnapLiteTest.cs similarity index 90% rename from PCL.Core.Test/SnapLiteTest.cs rename to PCL.CE.Test/SnapLiteTest.cs index c9ed12d98..c6bfc9ffb 100644 --- a/PCL.Core.Test/SnapLiteTest.cs +++ b/PCL.CE.Test/SnapLiteTest.cs @@ -2,9 +2,9 @@ using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Threading.Tasks; -using PCL.Core.Utils.VersionControl; +using PCL.CE.Core.Utils.VersionControl; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class SnapLiteTest diff --git a/PCL.Core.Test/ToastTest.cs b/PCL.CE.Test/ToastTest.cs similarity index 51% rename from PCL.Core.Test/ToastTest.cs rename to PCL.CE.Test/ToastTest.cs index 7a8994994..15445f1de 100644 --- a/PCL.Core.Test/ToastTest.cs +++ b/PCL.CE.Test/ToastTest.cs @@ -1,8 +1,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using static PCL.Core.UI.ToastNotification; +using static PCL.CE.Core.UI.ToastNotification; -namespace PCL.Core.Test; +namespace PCL.CE.Test; [TestClass] public class ToastTest @@ -10,6 +10,6 @@ public class ToastTest [TestMethod] public void TestToast() { - SendToast("A toast notice from PCL.Core!", "Test Toast"); + SendToast("A toast notice from PCL.CE.Core!", "Test Toast"); } } \ No newline at end of file diff --git a/PCL.Core.Test/Validate/BlacklistValidatorTest.cs b/PCL.CE.Test/Validate/BlacklistValidatorTest.cs similarity index 93% rename from PCL.Core.Test/Validate/BlacklistValidatorTest.cs rename to PCL.CE.Test/Validate/BlacklistValidatorTest.cs index cee2834ee..7ce174b77 100644 --- a/PCL.Core.Test/Validate/BlacklistValidatorTest.cs +++ b/PCL.CE.Test/Validate/BlacklistValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class BlacklistValidatorTest diff --git a/PCL.Core.Test/Validate/FileNameValidatorTest.cs b/PCL.CE.Test/Validate/FileNameValidatorTest.cs similarity index 96% rename from PCL.Core.Test/Validate/FileNameValidatorTest.cs rename to PCL.CE.Test/Validate/FileNameValidatorTest.cs index adb5456f4..9b7842885 100644 --- a/PCL.Core.Test/Validate/FileNameValidatorTest.cs +++ b/PCL.CE.Test/Validate/FileNameValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class FileNameValidatorTest diff --git a/PCL.Core.Test/Validate/FolderNameValidatorTest.cs b/PCL.CE.Test/Validate/FolderNameValidatorTest.cs similarity index 93% rename from PCL.Core.Test/Validate/FolderNameValidatorTest.cs rename to PCL.CE.Test/Validate/FolderNameValidatorTest.cs index 137be8895..91e3fac97 100644 --- a/PCL.Core.Test/Validate/FolderNameValidatorTest.cs +++ b/PCL.CE.Test/Validate/FolderNameValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class FolderNameValidatorTest diff --git a/PCL.Core.Test/Validate/FolderPathValidatorTest.cs b/PCL.CE.Test/Validate/FolderPathValidatorTest.cs similarity index 94% rename from PCL.Core.Test/Validate/FolderPathValidatorTest.cs rename to PCL.CE.Test/Validate/FolderPathValidatorTest.cs index d805faed7..046e837d4 100644 --- a/PCL.Core.Test/Validate/FolderPathValidatorTest.cs +++ b/PCL.CE.Test/Validate/FolderPathValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class FolderPathValidatorTest diff --git a/PCL.Core.Test/Validate/HttpAndUncValidatorTest.cs b/PCL.CE.Test/Validate/HttpAndUncValidatorTest.cs similarity index 93% rename from PCL.Core.Test/Validate/HttpAndUncValidatorTest.cs rename to PCL.CE.Test/Validate/HttpAndUncValidatorTest.cs index 9b6e3a5e5..1efd33239 100644 --- a/PCL.Core.Test/Validate/HttpAndUncValidatorTest.cs +++ b/PCL.CE.Test/Validate/HttpAndUncValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class HttpAndUncValidatorTest diff --git a/PCL.Core.Test/Validate/HttpValidatorTest.cs b/PCL.CE.Test/Validate/HttpValidatorTest.cs similarity index 92% rename from PCL.Core.Test/Validate/HttpValidatorTest.cs rename to PCL.CE.Test/Validate/HttpValidatorTest.cs index 2d842afbe..d5dd53ac9 100644 --- a/PCL.Core.Test/Validate/HttpValidatorTest.cs +++ b/PCL.CE.Test/Validate/HttpValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class HttpValidatorTest diff --git a/PCL.Core.Test/Validate/IntValidatorTest.cs b/PCL.CE.Test/Validate/IntValidatorTest.cs similarity index 92% rename from PCL.Core.Test/Validate/IntValidatorTest.cs rename to PCL.CE.Test/Validate/IntValidatorTest.cs index d89f7a9ef..f7a95cbb1 100644 --- a/PCL.Core.Test/Validate/IntValidatorTest.cs +++ b/PCL.CE.Test/Validate/IntValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class IntValidatorTest diff --git a/PCL.Core.Test/Validate/NullOrEmptyValidatorTest.cs b/PCL.CE.Test/Validate/NullOrEmptyValidatorTest.cs similarity index 91% rename from PCL.Core.Test/Validate/NullOrEmptyValidatorTest.cs rename to PCL.CE.Test/Validate/NullOrEmptyValidatorTest.cs index 2d59a714b..954b0b06d 100644 --- a/PCL.Core.Test/Validate/NullOrEmptyValidatorTest.cs +++ b/PCL.CE.Test/Validate/NullOrEmptyValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class NullOrEmptyValidatorTest diff --git a/PCL.Core.Test/Validate/NullOrWhiteSpaceValidatorTest.cs b/PCL.CE.Test/Validate/NullOrWhiteSpaceValidatorTest.cs similarity index 91% rename from PCL.Core.Test/Validate/NullOrWhiteSpaceValidatorTest.cs rename to PCL.CE.Test/Validate/NullOrWhiteSpaceValidatorTest.cs index c21213d11..e967fab15 100644 --- a/PCL.Core.Test/Validate/NullOrWhiteSpaceValidatorTest.cs +++ b/PCL.CE.Test/Validate/NullOrWhiteSpaceValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class NullOrWhiteSpaceValidatorTest diff --git a/PCL.Core.Test/Validate/StringLengthValidatorTest.cs b/PCL.CE.Test/Validate/StringLengthValidatorTest.cs similarity index 94% rename from PCL.Core.Test/Validate/StringLengthValidatorTest.cs rename to PCL.CE.Test/Validate/StringLengthValidatorTest.cs index 3e350a8fc..04de1e4bd 100644 --- a/PCL.Core.Test/Validate/StringLengthValidatorTest.cs +++ b/PCL.CE.Test/Validate/StringLengthValidatorTest.cs @@ -1,7 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL.Core.Test.Validate; +namespace PCL.CE.Test.Validate; [TestClass] public class StringLengthValidatorTest diff --git a/PCL.CE.slnx b/PCL.CE.slnx new file mode 100644 index 000000000..530287971 --- /dev/null +++ b/PCL.CE.slnx @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/Plain Craft Launcher 2/Application.xaml b/PCL.CE/Application.xaml similarity index 99% rename from Plain Craft Launcher 2/Application.xaml rename to PCL.CE/Application.xaml index 138a25548..9cf67949d 100644 --- a/Plain Craft Launcher 2/Application.xaml +++ b/PCL.CE/Application.xaml @@ -1,11 +1,11 @@ - diff --git a/Plain Craft Launcher 2/Application.xaml.cs b/PCL.CE/Application.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Application.xaml.cs rename to PCL.CE/Application.xaml.cs index 1e029bda3..b443c8fcd 100644 --- a/Plain Craft Launcher 2/Application.xaml.cs +++ b/PCL.CE/Application.xaml.cs @@ -6,13 +6,13 @@ using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Threading; -using PCL.Core.App; -using PCL.Core.App.IoC; -using PCL.Core.Logging; -using PCL.Core.Utils; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.OS; -namespace PCL; +namespace PCL.CE; public partial class Application { diff --git a/PCL.Core/AssemblyInfo.cs b/PCL.CE/AssemblyInfo.cs similarity index 51% rename from PCL.Core/AssemblyInfo.cs rename to PCL.CE/AssemblyInfo.cs index ae80aaabc..c5ec01f24 100644 --- a/PCL.Core/AssemblyInfo.cs +++ b/PCL.CE/AssemblyInfo.cs @@ -1,12 +1,12 @@ using System.Runtime.CompilerServices; using System.Windows.Markup; -[assembly: XmlnsDefinition("https://ce.pclc.cc/core/ui/animation", "PCL.Core.UI.Animation")] -[assembly: XmlnsDefinition("https://ce.pclc.cc/core/ui/animation", "PCL.Core.UI.Animation.Core")] -[assembly: XmlnsDefinition("https://ce.pclc.cc/core/ui/animation", "PCL.Core.UI.Animation.Easings")] +[assembly: XmlnsDefinition("https://ce.pclc.cc/core/ui/animation", "PCL.CE.Core.UI.Animation")] +[assembly: XmlnsDefinition("https://ce.pclc.cc/core/ui/animation", "PCL.CE.Core.UI.Animation.Core")] +[assembly: XmlnsDefinition("https://ce.pclc.cc/core/ui/animation", "PCL.CE.Core.UI.Animation.Easings")] [assembly: XmlnsPrefix("https://ce.pclc.cc/core/ui/animation", "ani")] -[assembly:XmlnsDefinition("https://ce.pclc.cc/core/utils/validate", "PCL.Core.Utils.Validate")] -[assembly:XmlnsPrefix("https://ce.pclc.cc/core/utils/validate", "val")] +[assembly: XmlnsDefinition("https://ce.pclc.cc/core/utils/validate", "PCL.CE.Core.Utils.Validate")] +[assembly: XmlnsPrefix("https://ce.pclc.cc/core/utils/validate", "val")] -[assembly: DisableRuntimeMarshalling] +[assembly: DisableRuntimeMarshalling] \ No newline at end of file diff --git a/Plain Craft Launcher 2/Controls/AnimatedBackgroundGrid.cs b/PCL.CE/Controls/AnimatedBackgroundGrid.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/AnimatedBackgroundGrid.cs rename to PCL.CE/Controls/AnimatedBackgroundGrid.cs index c9a3ec533..29d9f6281 100644 --- a/Plain Craft Launcher 2/Controls/AnimatedBackgroundGrid.cs +++ b/PCL.CE/Controls/AnimatedBackgroundGrid.cs @@ -2,7 +2,7 @@ using System.Windows.Controls; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public class AnimatedBackgroundGrid : Grid { diff --git a/Plain Craft Launcher 2/Controls/Behaviors/ClipboardInterceptor.cs b/PCL.CE/Controls/Behaviors/ClipboardInterceptor.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/Behaviors/ClipboardInterceptor.cs rename to PCL.CE/Controls/Behaviors/ClipboardInterceptor.cs index 223b20bd6..33a1888db 100644 --- a/Plain Craft Launcher 2/Controls/Behaviors/ClipboardInterceptor.cs +++ b/PCL.CE/Controls/Behaviors/ClipboardInterceptor.cs @@ -21,7 +21,7 @@ // // Date: 2025-07-03 -namespace PCL.Controls.Behaviors; +namespace PCL.CE.Controls.Behaviors; public sealed class ClipboardInterceptor { diff --git a/Plain Craft Launcher 2/Controls/Behaviors/LazyLoadBehavior.cs b/PCL.CE/Controls/Behaviors/LazyLoadBehavior.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/Behaviors/LazyLoadBehavior.cs rename to PCL.CE/Controls/Behaviors/LazyLoadBehavior.cs index 1af433fe3..be747319c 100644 --- a/Plain Craft Launcher 2/Controls/Behaviors/LazyLoadBehavior.cs +++ b/PCL.CE/Controls/Behaviors/LazyLoadBehavior.cs @@ -3,7 +3,7 @@ using System.Windows.Media; using Microsoft.Xaml.Behaviors; -namespace PCL; +namespace PCL.CE; internal static class LazyLoader { diff --git a/Plain Craft Launcher 2/Controls/FontSelector.xaml b/PCL.CE/Controls/FontSelector.xaml similarity index 92% rename from Plain Craft Launcher 2/Controls/FontSelector.xaml rename to PCL.CE/Controls/FontSelector.xaml index 41d96da2c..c9b7bdbeb 100644 --- a/Plain Craft Launcher 2/Controls/FontSelector.xaml +++ b/PCL.CE/Controls/FontSelector.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Controls/FontSelector.xaml.cs b/PCL.CE/Controls/FontSelector.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Controls/FontSelector.xaml.cs rename to PCL.CE/Controls/FontSelector.xaml.cs index 1084b918b..9dc851c81 100644 --- a/Plain Craft Launcher 2/Controls/FontSelector.xaml.cs +++ b/PCL.CE/Controls/FontSelector.xaml.cs @@ -2,10 +2,10 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Media; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; -namespace PCL; +namespace PCL.CE; public partial class FontSelector { diff --git a/Plain Craft Launcher 2/Controls/IMyRadio.cs b/PCL.CE/Controls/IMyRadio.cs similarity index 93% rename from Plain Craft Launcher 2/Controls/IMyRadio.cs rename to PCL.CE/Controls/IMyRadio.cs index 063906dfe..0f728f116 100644 --- a/Plain Craft Launcher 2/Controls/IMyRadio.cs +++ b/PCL.CE/Controls/IMyRadio.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public interface IMyRadio { diff --git a/Plain Craft Launcher 2/Controls/MinecraftServer.xaml b/PCL.CE/Controls/MinecraftServer.xaml similarity index 90% rename from Plain Craft Launcher 2/Controls/MinecraftServer.xaml rename to PCL.CE/Controls/MinecraftServer.xaml index b9cf8d22c..b4b343872 100644 --- a/Plain Craft Launcher 2/Controls/MinecraftServer.xaml +++ b/PCL.CE/Controls/MinecraftServer.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Controls/MinecraftServer.xaml.cs b/PCL.CE/Controls/MinecraftServer.xaml.cs similarity index 93% rename from Plain Craft Launcher 2/Controls/MinecraftServer.xaml.cs rename to PCL.CE/Controls/MinecraftServer.xaml.cs index c638aa2d4..d17c812fb 100644 --- a/Plain Craft Launcher 2/Controls/MinecraftServer.xaml.cs +++ b/PCL.CE/Controls/MinecraftServer.xaml.cs @@ -2,17 +2,17 @@ using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; -using PCL.Core.Link.McPing; -using PCL.Core.Link.McPing.Model; -using PCL.Core.Minecraft; -using PCL.Core.UI; +using PCL.CE.Core.Link.McPing; +using PCL.CE.Core.Link.McPing.Model; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.UI; -namespace PCL; +namespace PCL.CE; public partial class MinecraftServer : Grid { private const string FallbackImageUri = - "pack://application:,,,/Plain Craft Launcher 2;component/Images/Icons/DefaultServer.png"; + "pack://application:,,,/PCL.CE;component/Images/Icons/DefaultServer.png"; private static readonly DependencyProperty AddressProperty = DependencyProperty.Register(nameof(Address), typeof(string), typeof(MinecraftServer), new PropertyMetadata(string.Empty, OnAddressChanged)); diff --git a/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml b/PCL.CE/Controls/MinecraftServerQuery.xaml similarity index 87% rename from Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml rename to PCL.CE/Controls/MinecraftServerQuery.xaml index 5fa616528..b06c8d894 100644 --- a/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml +++ b/PCL.CE/Controls/MinecraftServerQuery.xaml @@ -1,11 +1,11 @@ - @@ -29,7 +29,7 @@ - diff --git a/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.cs b/PCL.CE/Controls/MinecraftServerQuery.xaml.cs similarity index 97% rename from Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.cs rename to PCL.CE/Controls/MinecraftServerQuery.xaml.cs index 8b8158d2d..2169daa5e 100644 --- a/Plain Craft Launcher 2/Controls/MinecraftServerQuery.xaml.cs +++ b/PCL.CE/Controls/MinecraftServerQuery.xaml.cs @@ -2,7 +2,7 @@ using System.Windows.Controls; using System.Windows.Input; -namespace PCL; +namespace PCL.CE; public partial class MinecraftServerQuery : Grid { diff --git a/Plain Craft Launcher 2/Controls/MyButton.xaml b/PCL.CE/Controls/MyButton.xaml similarity index 97% rename from Plain Craft Launcher 2/Controls/MyButton.xaml rename to PCL.CE/Controls/MyButton.xaml index 7ba584a10..2142d35a3 100644 --- a/Plain Craft Launcher 2/Controls/MyButton.xaml +++ b/PCL.CE/Controls/MyButton.xaml @@ -1,4 +1,4 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyExtraButton.xaml.cs b/PCL.CE/Controls/MyExtraButton.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyExtraButton.xaml.cs rename to PCL.CE/Controls/MyExtraButton.xaml.cs index f519d851f..7c1b917bf 100644 --- a/Plain Craft Launcher 2/Controls/MyExtraButton.xaml.cs +++ b/PCL.CE/Controls/MyExtraButton.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Input; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class MyExtraButton { diff --git a/Plain Craft Launcher 2/Controls/MyExtraTextButton.xaml b/PCL.CE/Controls/MyExtraTextButton.xaml similarity index 96% rename from Plain Craft Launcher 2/Controls/MyExtraTextButton.xaml rename to PCL.CE/Controls/MyExtraTextButton.xaml index d09b57c6f..c1c4fbca6 100644 --- a/Plain Craft Launcher 2/Controls/MyExtraTextButton.xaml +++ b/PCL.CE/Controls/MyExtraTextButton.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - x:Name="PanBack" mc:Ignorable="d" x:Class="PCL.MyExtraTextButton" + x:Name="PanBack" mc:Ignorable="d" x:Class="PCL.CE.MyExtraTextButton" RenderTransformOrigin="0.5,0.5" ToolTipService.Placement="Left" Height="52" Margin="20"> diff --git a/Plain Craft Launcher 2/Controls/MyExtraTextButton.xaml.cs b/PCL.CE/Controls/MyExtraTextButton.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyExtraTextButton.xaml.cs rename to PCL.CE/Controls/MyExtraTextButton.xaml.cs index 03116a6c1..677c0de06 100644 --- a/Plain Craft Launcher 2/Controls/MyExtraTextButton.xaml.cs +++ b/PCL.CE/Controls/MyExtraTextButton.xaml.cs @@ -4,7 +4,7 @@ using System.Windows.Markup; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; [ContentProperty("Inlines")] public partial class MyExtraTextButton diff --git a/Plain Craft Launcher 2/Controls/MyHint.xaml b/PCL.CE/Controls/MyHint.xaml similarity index 92% rename from Plain Craft Launcher 2/Controls/MyHint.xaml rename to PCL.CE/Controls/MyHint.xaml index b4dff47e9..814aed18a 100644 --- a/Plain Craft Launcher 2/Controls/MyHint.xaml +++ b/PCL.CE/Controls/MyHint.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyHint.xaml.cs b/PCL.CE/Controls/MyHint.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyHint.xaml.cs rename to PCL.CE/Controls/MyHint.xaml.cs index f99485787..720e4d8f1 100644 --- a/Plain Craft Launcher 2/Controls/MyHint.xaml.cs +++ b/PCL.CE/Controls/MyHint.xaml.cs @@ -3,11 +3,11 @@ using System.Windows.Input; using System.Windows.Markup; -using PCL.Core.App; -using PCL.Core.UI.Theme; +using PCL.CE.Core.App; +using PCL.CE.Core.UI.Theme; using System.Windows.Controls; -namespace PCL; +namespace PCL.CE; [ContentProperty("Inlines")] public partial class MyHint diff --git a/Plain Craft Launcher 2/Controls/MyIconButton.xaml b/PCL.CE/Controls/MyIconButton.xaml similarity index 94% rename from Plain Craft Launcher 2/Controls/MyIconButton.xaml rename to PCL.CE/Controls/MyIconButton.xaml index ff7f5f228..4f3b5c3e9 100644 --- a/Plain Craft Launcher 2/Controls/MyIconButton.xaml +++ b/PCL.CE/Controls/MyIconButton.xaml @@ -1,4 +1,4 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyIconButton.xaml.cs b/PCL.CE/Controls/MyIconButton.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyIconButton.xaml.cs rename to PCL.CE/Controls/MyIconButton.xaml.cs index 0f599b6a8..66242f0e6 100644 --- a/Plain Craft Launcher 2/Controls/MyIconButton.xaml.cs +++ b/PCL.CE/Controls/MyIconButton.xaml.cs @@ -4,7 +4,7 @@ using System.Windows.Shapes; using System.Windows.Controls; -namespace PCL; +namespace PCL.CE; public partial class MyIconButton { diff --git a/Plain Craft Launcher 2/Controls/MyIconTextButton.xaml b/PCL.CE/Controls/MyIconTextButton.xaml similarity index 92% rename from Plain Craft Launcher 2/Controls/MyIconTextButton.xaml rename to PCL.CE/Controls/MyIconTextButton.xaml index 5dcb78359..ffb7fee3c 100644 --- a/Plain Craft Launcher 2/Controls/MyIconTextButton.xaml +++ b/PCL.CE/Controls/MyIconTextButton.xaml @@ -1,4 +1,4 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyLoading.xaml.cs b/PCL.CE/Controls/MyLoading.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyLoading.xaml.cs rename to PCL.CE/Controls/MyLoading.xaml.cs index 97ce6b4fc..cd7a36b46 100644 --- a/Plain Craft Launcher 2/Controls/MyLoading.xaml.cs +++ b/PCL.CE/Controls/MyLoading.xaml.cs @@ -2,9 +2,9 @@ using System.Windows; using System.Windows.Input; using System.Windows.Media; -using static PCL.MyLoading; +using static PCL.CE.MyLoading; -namespace PCL; +namespace PCL.CE; public partial class MyLoading { diff --git a/Plain Craft Launcher 2/Controls/MyMenuItem.cs b/PCL.CE/Controls/MyMenuItem.cs similarity index 98% rename from Plain Craft Launcher 2/Controls/MyMenuItem.cs rename to PCL.CE/Controls/MyMenuItem.cs index 9fedff5ce..42ce59511 100644 --- a/Plain Craft Launcher 2/Controls/MyMenuItem.cs +++ b/PCL.CE/Controls/MyMenuItem.cs @@ -2,9 +2,9 @@ using System.Windows.Controls; using System.Windows.Media; using System.Windows.Shapes; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public class MyMenuItem : MenuItem { diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgInput.xaml b/PCL.CE/Controls/MyMsg/MyMsgInput.xaml similarity index 97% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgInput.xaml rename to PCL.CE/Controls/MyMsg/MyMsgInput.xaml index f0a783de9..b90be8493 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgInput.xaml +++ b/PCL.CE/Controls/MyMsg/MyMsgInput.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgInput.xaml.cs b/PCL.CE/Controls/MyMsg/MyMsgInput.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgInput.xaml.cs rename to PCL.CE/Controls/MyMsg/MyMsgInput.xaml.cs index 4ee3b41f3..5b3f5414e 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgInput.xaml.cs +++ b/PCL.CE/Controls/MyMsg/MyMsgInput.xaml.cs @@ -2,9 +2,9 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Interop; -using PCL.Core.UI.Controls; +using PCL.CE.Core.UI.Controls; -namespace PCL; +namespace PCL.CE; public partial class MyMsgInput { diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml b/PCL.CE/Controls/MyMsg/MyMsgMarkdown.xaml similarity index 97% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml rename to PCL.CE/Controls/MyMsg/MyMsgMarkdown.xaml index d34fd682f..450a9abf9 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml +++ b/PCL.CE/Controls/MyMsg/MyMsgMarkdown.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml.cs b/PCL.CE/Controls/MyMsg/MyMsgMarkdown.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml.cs rename to PCL.CE/Controls/MyMsg/MyMsgMarkdown.xaml.cs index b46a21b67..51f584e26 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgMarkdown.xaml.cs +++ b/PCL.CE/Controls/MyMsg/MyMsgMarkdown.xaml.cs @@ -2,9 +2,9 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Interop; -using PCL.Core.UI.Controls; +using PCL.CE.Core.UI.Controls; -namespace PCL; +namespace PCL.CE; public partial class MyMsgMarkdown { diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgSelect.xaml b/PCL.CE/Controls/MyMsg/MyMsgSelect.xaml similarity index 97% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgSelect.xaml rename to PCL.CE/Controls/MyMsg/MyMsgSelect.xaml index 1ba30ccf8..b49a88860 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgSelect.xaml +++ b/PCL.CE/Controls/MyMsg/MyMsgSelect.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgSelect.xaml.cs b/PCL.CE/Controls/MyMsg/MyMsgSelect.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgSelect.xaml.cs rename to PCL.CE/Controls/MyMsg/MyMsgSelect.xaml.cs index 7824eacee..c94c26f03 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgSelect.xaml.cs +++ b/PCL.CE/Controls/MyMsg/MyMsgSelect.xaml.cs @@ -3,9 +3,9 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Interop; -using PCL.Core.UI.Controls; +using PCL.CE.Core.UI.Controls; -namespace PCL; +namespace PCL.CE; public partial class MyMsgSelect { diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml b/PCL.CE/Controls/MyMsg/MyMsgText.xaml similarity index 97% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml rename to PCL.CE/Controls/MyMsg/MyMsgText.xaml index ed540acd2..40bf08646 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml +++ b/PCL.CE/Controls/MyMsg/MyMsgText.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml.cs b/PCL.CE/Controls/MyMsg/MyMsgText.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml.cs rename to PCL.CE/Controls/MyMsg/MyMsgText.xaml.cs index 2cf1bd49b..a63597cf8 100644 --- a/Plain Craft Launcher 2/Controls/MyMsg/MyMsgText.xaml.cs +++ b/PCL.CE/Controls/MyMsg/MyMsgText.xaml.cs @@ -2,9 +2,9 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Interop; -using PCL.Core.UI.Controls; +using PCL.CE.Core.UI.Controls; -namespace PCL; +namespace PCL.CE; public partial class MyMsgText { diff --git a/Plain Craft Launcher 2/Controls/MyPageLeft.cs b/PCL.CE/Controls/MyPageLeft.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyPageLeft.cs rename to PCL.CE/Controls/MyPageLeft.cs index a645e17d1..340aa2afe 100644 --- a/Plain Craft Launcher 2/Controls/MyPageLeft.cs +++ b/PCL.CE/Controls/MyPageLeft.cs @@ -2,7 +2,7 @@ using System.Windows.Controls; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public class MyPageLeft : Grid { diff --git a/Plain Craft Launcher 2/Controls/MyPageRight.cs b/PCL.CE/Controls/MyPageRight.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MyPageRight.cs rename to PCL.CE/Controls/MyPageRight.cs index 329fa4ca2..d54832c06 100644 --- a/Plain Craft Launcher 2/Controls/MyPageRight.cs +++ b/PCL.CE/Controls/MyPageRight.cs @@ -2,9 +2,9 @@ using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Media; -using static PCL.ModLoader; +using static PCL.CE.ModLoader; -namespace PCL; +namespace PCL.CE; public class MyPageRight : AdornerDecorator { diff --git a/Plain Craft Launcher 2/Controls/MyRadioBox.xaml b/PCL.CE/Controls/MyRadioBox.xaml similarity index 96% rename from Plain Craft Launcher 2/Controls/MyRadioBox.xaml rename to PCL.CE/Controls/MyRadioBox.xaml index fe76415a3..8cd9d140e 100644 --- a/Plain Craft Launcher 2/Controls/MyRadioBox.xaml +++ b/PCL.CE/Controls/MyRadioBox.xaml @@ -1,4 +1,4 @@ - diff --git a/Plain Craft Launcher 2/Controls/MySearchBox.xaml.cs b/PCL.CE/Controls/MySearchBox.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Controls/MySearchBox.xaml.cs rename to PCL.CE/Controls/MySearchBox.xaml.cs index d2067d959..5ee366ffe 100644 --- a/Plain Craft Launcher 2/Controls/MySearchBox.xaml.cs +++ b/PCL.CE/Controls/MySearchBox.xaml.cs @@ -2,7 +2,7 @@ using System.Windows.Controls; using System.Windows.Input; -namespace PCL; +namespace PCL.CE; public partial class MySearchBox : MyCard { diff --git a/Plain Craft Launcher 2/Controls/MySlider.xaml b/PCL.CE/Controls/MySlider.xaml similarity index 98% rename from Plain Craft Launcher 2/Controls/MySlider.xaml rename to PCL.CE/Controls/MySlider.xaml index f73a30bdf..5669ba5a0 100644 --- a/Plain Craft Launcher 2/Controls/MySlider.xaml +++ b/PCL.CE/Controls/MySlider.xaml @@ -1,4 +1,4 @@ - : FrameworkElement where T : FrameworkElement { diff --git a/PCL.Core/App/Basics.cs b/PCL.CE/Core/App/Basics.cs similarity index 97% rename from PCL.Core/App/Basics.cs rename to PCL.CE/Core/App/Basics.cs index 3be72a923..23fd176c7 100644 --- a/PCL.Core/App/Basics.cs +++ b/PCL.CE/Core/App/Basics.cs @@ -6,10 +6,10 @@ using System.Text.Json; using System.Threading; using System.Windows; -using PCL.Core.Logging; -using PCL.Core.Utils; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; -namespace PCL.Core.App; +namespace PCL.CE.Core.App; /// /// 基础工具集。 @@ -22,7 +22,7 @@ public static class Basics /// 启动器元数据。 /// public static MetadataModel Metadata { get; } = JsonSerializer.Deserialize( - Assembly.GetEntryAssembly()!.GetManifestResourceStream("PCL.metadata.json")!)!; + Assembly.GetEntryAssembly()!.GetManifestResourceStream("PCL.CE.metadata.json")!)!; /// /// 版本名称。 @@ -176,7 +176,7 @@ public static void OpenPath(string path, string? workingDirectory = null) return resourceInfo?.Stream; } - private const string AssemblyImagePath = "pack://application:,,,/Plain Craft Launcher 2;component/Images/"; + private const string AssemblyImagePath = "pack://application:,,,/PCL.CE;component/Images/"; public static string GetAppImagePath(string imageName) => AssemblyImagePath + imageName; #endregion diff --git a/PCL.Core/App/Cli/ArgumentValueKind.cs b/PCL.CE/Core/App/Cli/ArgumentValueKind.cs similarity index 66% rename from PCL.Core/App/Cli/ArgumentValueKind.cs rename to PCL.CE/Core/App/Cli/ArgumentValueKind.cs index 3d687db04..60a5fa10a 100644 --- a/PCL.Core/App/Cli/ArgumentValueKind.cs +++ b/PCL.CE/Core/App/Cli/ArgumentValueKind.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; public enum ArgumentValueKind { diff --git a/PCL.Core/App/Cli/BoolArgument.cs b/PCL.CE/Core/App/Cli/BoolArgument.cs similarity index 97% rename from PCL.Core/App/Cli/BoolArgument.cs rename to PCL.CE/Core/App/Cli/BoolArgument.cs index 7823dcbfd..7e968ac0d 100644 --- a/PCL.Core/App/Cli/BoolArgument.cs +++ b/PCL.CE/Core/App/Cli/BoolArgument.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; public class BoolArgument : CommandArgument { diff --git a/PCL.Core/App/Cli/CommandArgument.cs b/PCL.CE/Core/App/Cli/CommandArgument.cs similarity index 98% rename from PCL.Core/App/Cli/CommandArgument.cs rename to PCL.CE/Core/App/Cli/CommandArgument.cs index 7a79c13bd..b4d1451c2 100644 --- a/PCL.Core/App/Cli/CommandArgument.cs +++ b/PCL.CE/Core/App/Cli/CommandArgument.cs @@ -2,7 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; /// /// 无泛型的命令行参数模型 diff --git a/PCL.Core/App/Cli/CommandLine.cs b/PCL.CE/Core/App/Cli/CommandLine.cs similarity index 99% rename from PCL.Core/App/Cli/CommandLine.cs rename to PCL.CE/Core/App/Cli/CommandLine.cs index 6fd96c45b..97c5f9920 100644 --- a/PCL.Core/App/Cli/CommandLine.cs +++ b/PCL.CE/Core/App/Cli/CommandLine.cs @@ -5,7 +5,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; /// /// 命令行模型 diff --git a/PCL.Core/App/Cli/DecimalArgument.cs b/PCL.CE/Core/App/Cli/DecimalArgument.cs similarity index 98% rename from PCL.Core/App/Cli/DecimalArgument.cs rename to PCL.CE/Core/App/Cli/DecimalArgument.cs index fd6a36ce1..b93437695 100644 --- a/PCL.Core/App/Cli/DecimalArgument.cs +++ b/PCL.CE/Core/App/Cli/DecimalArgument.cs @@ -2,7 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; public class DecimalArgument : CommandArgument { diff --git a/PCL.Core/App/Cli/SubcommandDefinition.cs b/PCL.CE/Core/App/Cli/SubcommandDefinition.cs similarity index 97% rename from PCL.Core/App/Cli/SubcommandDefinition.cs rename to PCL.CE/Core/App/Cli/SubcommandDefinition.cs index 0ab8b9645..0030bd1fe 100644 --- a/PCL.Core/App/Cli/SubcommandDefinition.cs +++ b/PCL.CE/Core/App/Cli/SubcommandDefinition.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; public class SubcommandDefinition { diff --git a/PCL.Core/App/Cli/TextArgument.cs b/PCL.CE/Core/App/Cli/TextArgument.cs similarity index 85% rename from PCL.Core/App/Cli/TextArgument.cs rename to PCL.CE/Core/App/Cli/TextArgument.cs index 2e89cd79c..da2f44c65 100644 --- a/PCL.Core/App/Cli/TextArgument.cs +++ b/PCL.CE/Core/App/Cli/TextArgument.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Cli; +namespace PCL.CE.Core.App.Cli; public class TextArgument : CommandArgument { diff --git a/PCL.Core/App/Config.cs b/PCL.CE/Core/App/Config.cs similarity index 99% rename from PCL.Core/App/Config.cs rename to PCL.CE/Core/App/Config.cs index 1ff4c17ef..fef925d62 100644 --- a/PCL.Core/App/Config.cs +++ b/PCL.CE/Core/App/Config.cs @@ -1,6 +1,6 @@ -using PCL.Core.App.Configuration; +using PCL.CE.Core.App.Configuration; -namespace PCL.Core.App; +namespace PCL.CE.Core.App; /// /// 全局配置类。 diff --git a/PCL.Core/App/ConfigEnums.cs b/PCL.CE/Core/App/ConfigEnums.cs similarity index 98% rename from PCL.Core/App/ConfigEnums.cs rename to PCL.CE/Core/App/ConfigEnums.cs index d6021120f..e6594ac70 100644 --- a/PCL.Core/App/ConfigEnums.cs +++ b/PCL.CE/Core/App/ConfigEnums.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App; +namespace PCL.CE.Core.App; /// /// 联机协议偏好 diff --git a/PCL.Core/App/Configuration/ArgConfig.cs b/PCL.CE/Core/App/Configuration/ArgConfig.cs similarity index 78% rename from PCL.Core/App/Configuration/ArgConfig.cs rename to PCL.CE/Core/App/Configuration/ArgConfig.cs index 000055b77..b46cff959 100644 --- a/PCL.Core/App/Configuration/ArgConfig.cs +++ b/PCL.CE/Core/App/Configuration/ArgConfig.cs @@ -1,7 +1,7 @@ using System; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; public class ArgConfig : ParameterizedProperty { diff --git a/PCL.Core/App/Configuration/Attributes.cs b/PCL.CE/Core/App/Configuration/Attributes.cs similarity index 97% rename from PCL.Core/App/Configuration/Attributes.cs rename to PCL.CE/Core/App/Configuration/Attributes.cs index b4bdadb2d..b6ed01d04 100644 --- a/PCL.Core/App/Configuration/Attributes.cs +++ b/PCL.CE/Core/App/Configuration/Attributes.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; #pragma warning disable CS9113 // Parameter is unread. diff --git a/PCL.Core/App/Configuration/ConfigEvent.cs b/PCL.CE/Core/App/Configuration/ConfigEvent.cs similarity index 96% rename from PCL.Core/App/Configuration/ConfigEvent.cs rename to PCL.CE/Core/App/Configuration/ConfigEvent.cs index 7473ece38..8a7e3c85c 100644 --- a/PCL.Core/App/Configuration/ConfigEvent.cs +++ b/PCL.CE/Core/App/Configuration/ConfigEvent.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置项事件。 diff --git a/PCL.Core/App/Configuration/ConfigEventArgs.cs b/PCL.CE/Core/App/Configuration/ConfigEventArgs.cs similarity index 95% rename from PCL.Core/App/Configuration/ConfigEventArgs.cs rename to PCL.CE/Core/App/Configuration/ConfigEventArgs.cs index 3e86ea197..4f7a33499 100644 --- a/PCL.Core/App/Configuration/ConfigEventArgs.cs +++ b/PCL.CE/Core/App/Configuration/ConfigEventArgs.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置项事件参数。 diff --git a/PCL.Core/App/Configuration/ConfigEventHandler.cs b/PCL.CE/Core/App/Configuration/ConfigEventHandler.cs similarity index 78% rename from PCL.Core/App/Configuration/ConfigEventHandler.cs rename to PCL.CE/Core/App/Configuration/ConfigEventHandler.cs index e1b013362..a46b737f5 100644 --- a/PCL.Core/App/Configuration/ConfigEventHandler.cs +++ b/PCL.CE/Core/App/Configuration/ConfigEventHandler.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置项监听委托。 diff --git a/PCL.Core/App/Configuration/ConfigEventRegistry.cs b/PCL.CE/Core/App/Configuration/ConfigEventRegistry.cs similarity index 94% rename from PCL.Core/App/Configuration/ConfigEventRegistry.cs rename to PCL.CE/Core/App/Configuration/ConfigEventRegistry.cs index 0aaa1782a..b9f3f2c48 100644 --- a/PCL.Core/App/Configuration/ConfigEventRegistry.cs +++ b/PCL.CE/Core/App/Configuration/ConfigEventRegistry.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; public class ConfigEventRegistry( IEnumerable scope, diff --git a/PCL.Core/App/Configuration/ConfigItem.cs b/PCL.CE/Core/App/Configuration/ConfigItem.cs similarity index 99% rename from PCL.Core/App/Configuration/ConfigItem.cs rename to PCL.CE/Core/App/Configuration/ConfigItem.cs index 85719b8d4..410a2ac7b 100644 --- a/PCL.Core/App/Configuration/ConfigItem.cs +++ b/PCL.CE/Core/App/Configuration/ConfigItem.cs @@ -3,9 +3,9 @@ using System.Collections.Specialized; using System.ComponentModel; using System.Linq; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置项。 diff --git a/PCL.Core/App/Configuration/ConfigMigration.cs b/PCL.CE/Core/App/Configuration/ConfigMigration.cs similarity index 99% rename from PCL.Core/App/Configuration/ConfigMigration.cs rename to PCL.CE/Core/App/Configuration/ConfigMigration.cs index ad855d4a7..f8a311da4 100644 --- a/PCL.Core/App/Configuration/ConfigMigration.cs +++ b/PCL.CE/Core/App/Configuration/ConfigMigration.cs @@ -4,7 +4,7 @@ using System.IO; using System.Linq; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; public delegate void ConfigMigrationHandler(string from, string to); diff --git a/PCL.Core/App/Configuration/ConfigObserver.cs b/PCL.CE/Core/App/Configuration/ConfigObserver.cs similarity index 90% rename from PCL.Core/App/Configuration/ConfigObserver.cs rename to PCL.CE/Core/App/Configuration/ConfigObserver.cs index 8c94214bb..35ab7d007 100644 --- a/PCL.Core/App/Configuration/ConfigObserver.cs +++ b/PCL.CE/Core/App/Configuration/ConfigObserver.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置事件观察器。 diff --git a/PCL.Core/App/Configuration/ConfigService.cs b/PCL.CE/Core/App/Configuration/ConfigService.cs similarity index 98% rename from PCL.Core/App/Configuration/ConfigService.cs rename to PCL.CE/Core/App/Configuration/ConfigService.cs index 97c9a3df9..9873883a8 100644 --- a/PCL.Core/App/Configuration/ConfigService.cs +++ b/PCL.CE/Core/App/Configuration/ConfigService.cs @@ -5,12 +5,12 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using PCL.Core.App.Configuration.Storage; -using PCL.Core.App.IoC; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App.Configuration.Storage; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 全局配置服务。 diff --git a/PCL.Core/App/Configuration/ConfigSource.cs b/PCL.CE/Core/App/Configuration/ConfigSource.cs similarity index 90% rename from PCL.Core/App/Configuration/ConfigSource.cs rename to PCL.CE/Core/App/Configuration/ConfigSource.cs index 467ac831a..d55caa23c 100644 --- a/PCL.Core/App/Configuration/ConfigSource.cs +++ b/PCL.CE/Core/App/Configuration/ConfigSource.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置来源。 diff --git a/PCL.Core/App/Configuration/ConfigValueCache.cs b/PCL.CE/Core/App/Configuration/ConfigValueCache.cs similarity index 98% rename from PCL.Core/App/Configuration/ConfigValueCache.cs rename to PCL.CE/Core/App/Configuration/ConfigValueCache.cs index a13c9a92e..1f7525ccd 100644 --- a/PCL.Core/App/Configuration/ConfigValueCache.cs +++ b/PCL.CE/Core/App/Configuration/ConfigValueCache.cs @@ -1,7 +1,7 @@ using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; public struct ConfigValueCache() { diff --git a/PCL.Core/App/Configuration/IConfigProvider.cs b/PCL.CE/Core/App/Configuration/IConfigProvider.cs similarity index 97% rename from PCL.Core/App/Configuration/IConfigProvider.cs rename to PCL.CE/Core/App/Configuration/IConfigProvider.cs index a905bea6f..4bc7a6eb1 100644 --- a/PCL.Core/App/Configuration/IConfigProvider.cs +++ b/PCL.CE/Core/App/Configuration/IConfigProvider.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; public interface IConfigProvider { diff --git a/PCL.Core/App/Configuration/IConfigScope.cs b/PCL.CE/Core/App/Configuration/IConfigScope.cs similarity index 96% rename from PCL.Core/App/Configuration/IConfigScope.cs rename to PCL.CE/Core/App/Configuration/IConfigScope.cs index 162950a45..b623ad538 100644 --- a/PCL.Core/App/Configuration/IConfigScope.cs +++ b/PCL.CE/Core/App/Configuration/IConfigScope.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.App.Configuration; +namespace PCL.CE.Core.App.Configuration; /// /// 配置作用域。 diff --git a/PCL.Core/App/Configuration/Storage/CatIniFileProvider.cs b/PCL.CE/Core/App/Configuration/Storage/CatIniFileProvider.cs similarity index 95% rename from PCL.Core/App/Configuration/Storage/CatIniFileProvider.cs rename to PCL.CE/Core/App/Configuration/Storage/CatIniFileProvider.cs index 8274c7b0d..9385caa86 100644 --- a/PCL.Core/App/Configuration/Storage/CatIniFileProvider.cs +++ b/PCL.CE/Core/App/Configuration/Storage/CatIniFileProvider.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.IO; using System.Text; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; /// /// 提供 LTCat-style ini 格式的键值文件读写。 diff --git a/PCL.Core/App/Configuration/Storage/CommonFileProvider.cs b/PCL.CE/Core/App/Configuration/Storage/CommonFileProvider.cs similarity index 92% rename from PCL.Core/App/Configuration/Storage/CommonFileProvider.cs rename to PCL.CE/Core/App/Configuration/Storage/CommonFileProvider.cs index 0c1ad2bbe..1a8fd32eb 100644 --- a/PCL.Core/App/Configuration/Storage/CommonFileProvider.cs +++ b/PCL.CE/Core/App/Configuration/Storage/CommonFileProvider.cs @@ -1,7 +1,7 @@ using System.IO; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; public abstract class CommonFileProvider(string path) : IKeyValueFileProvider { diff --git a/PCL.Core/App/Configuration/Storage/ConfigFileInitException.cs b/PCL.CE/Core/App/Configuration/Storage/ConfigFileInitException.cs similarity index 83% rename from PCL.Core/App/Configuration/Storage/ConfigFileInitException.cs rename to PCL.CE/Core/App/Configuration/Storage/ConfigFileInitException.cs index 9495e9d43..1f25f1bb2 100644 --- a/PCL.Core/App/Configuration/Storage/ConfigFileInitException.cs +++ b/PCL.CE/Core/App/Configuration/Storage/ConfigFileInitException.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; public class ConfigFileInitException(string path, string message, Exception? inner = null) : Exception(message, inner) diff --git a/PCL.Core/App/Configuration/Storage/ConfigStorage.cs b/PCL.CE/Core/App/Configuration/Storage/ConfigStorage.cs similarity index 97% rename from PCL.Core/App/Configuration/Storage/ConfigStorage.cs rename to PCL.CE/Core/App/Configuration/Storage/ConfigStorage.cs index dac4056f5..4ab6cb429 100644 --- a/PCL.Core/App/Configuration/Storage/ConfigStorage.cs +++ b/PCL.CE/Core/App/Configuration/Storage/ConfigStorage.cs @@ -3,11 +3,11 @@ using System.Linq; using System.Text.Encodings.Web; using System.Text.Json; -using PCL.Core.App.IoC; -using PCL.Core.Logging; -using PCL.Core.Utils.Diagnostics; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Diagnostics; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; public enum StorageAction { diff --git a/PCL.Core/App/Configuration/Storage/DynamicCacheConfigStorage.cs b/PCL.CE/Core/App/Configuration/Storage/DynamicCacheConfigStorage.cs similarity index 97% rename from PCL.Core/App/Configuration/Storage/DynamicCacheConfigStorage.cs rename to PCL.CE/Core/App/Configuration/Storage/DynamicCacheConfigStorage.cs index 0a702b0c6..78708910d 100644 --- a/PCL.Core/App/Configuration/Storage/DynamicCacheConfigStorage.cs +++ b/PCL.CE/Core/App/Configuration/Storage/DynamicCacheConfigStorage.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; public class DynamicCacheConfigStorage : ConfigStorage { diff --git a/PCL.Core/App/Configuration/Storage/EncryptedFileConfigStorage.cs b/PCL.CE/Core/App/Configuration/Storage/EncryptedFileConfigStorage.cs similarity index 96% rename from PCL.Core/App/Configuration/Storage/EncryptedFileConfigStorage.cs rename to PCL.CE/Core/App/Configuration/Storage/EncryptedFileConfigStorage.cs index e848b1c03..fe654f956 100644 --- a/PCL.Core/App/Configuration/Storage/EncryptedFileConfigStorage.cs +++ b/PCL.CE/Core/App/Configuration/Storage/EncryptedFileConfigStorage.cs @@ -3,10 +3,10 @@ using System.Runtime.CompilerServices; using System.Text.Json; using System.Text.Json.Serialization; -using PCL.Core.Logging; -using PCL.Core.Utils.Secret; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Secret; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; public class EncryptedFileConfigStorage(ConfigStorage source) : ConfigStorage { diff --git a/PCL.Core/App/Configuration/Storage/FileConfigStorage.cs b/PCL.CE/Core/App/Configuration/Storage/FileConfigStorage.cs similarity index 97% rename from PCL.Core/App/Configuration/Storage/FileConfigStorage.cs rename to PCL.CE/Core/App/Configuration/Storage/FileConfigStorage.cs index 6465f86f8..37946b881 100644 --- a/PCL.Core/App/Configuration/Storage/FileConfigStorage.cs +++ b/PCL.CE/Core/App/Configuration/Storage/FileConfigStorage.cs @@ -5,10 +5,10 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; -using PCL.Core.Logging; -using PCL.Core.UI; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; /// /// 文件存取仓库。 diff --git a/PCL.Core/App/Configuration/Storage/IEnumerableKeyProvider.cs b/PCL.CE/Core/App/Configuration/Storage/IEnumerableKeyProvider.cs similarity index 83% rename from PCL.Core/App/Configuration/Storage/IEnumerableKeyProvider.cs rename to PCL.CE/Core/App/Configuration/Storage/IEnumerableKeyProvider.cs index 6462b1e88..8e2b88a80 100644 --- a/PCL.Core/App/Configuration/Storage/IEnumerableKeyProvider.cs +++ b/PCL.CE/Core/App/Configuration/Storage/IEnumerableKeyProvider.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; public interface IEnumerableKeyProvider { diff --git a/PCL.Core/App/Configuration/Storage/IKeyValueFileProvider.cs b/PCL.CE/Core/App/Configuration/Storage/IKeyValueFileProvider.cs similarity index 93% rename from PCL.Core/App/Configuration/Storage/IKeyValueFileProvider.cs rename to PCL.CE/Core/App/Configuration/Storage/IKeyValueFileProvider.cs index 95a709663..f8b4fa61f 100644 --- a/PCL.Core/App/Configuration/Storage/IKeyValueFileProvider.cs +++ b/PCL.CE/Core/App/Configuration/Storage/IKeyValueFileProvider.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; /// /// 键值文件模型。 diff --git a/PCL.Core/App/Configuration/Storage/JsonFileProvider.cs b/PCL.CE/Core/App/Configuration/Storage/JsonFileProvider.cs similarity index 98% rename from PCL.Core/App/Configuration/Storage/JsonFileProvider.cs rename to PCL.CE/Core/App/Configuration/Storage/JsonFileProvider.cs index 5739f080f..dfe14ed1c 100644 --- a/PCL.Core/App/Configuration/Storage/JsonFileProvider.cs +++ b/PCL.CE/Core/App/Configuration/Storage/JsonFileProvider.cs @@ -6,7 +6,7 @@ using System.Text.Json.Nodes; using System.Text.Json.Serialization; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; /// /// 提供 JSON 格式的键值文件读写。 diff --git a/PCL.Core/App/Configuration/Storage/JsonToYamlConverter.cs b/PCL.CE/Core/App/Configuration/Storage/JsonToYamlConverter.cs similarity index 98% rename from PCL.Core/App/Configuration/Storage/JsonToYamlConverter.cs rename to PCL.CE/Core/App/Configuration/Storage/JsonToYamlConverter.cs index 5c3574749..d3312e4c0 100644 --- a/PCL.Core/App/Configuration/Storage/JsonToYamlConverter.cs +++ b/PCL.CE/Core/App/Configuration/Storage/JsonToYamlConverter.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using YamlDotNet.Serialization; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; // Partly generated by gpt-5-mini (20250903) public static class JsonToYamlConverter diff --git a/PCL.Core/App/Configuration/Storage/YamlFileProvider.cs b/PCL.CE/Core/App/Configuration/Storage/YamlFileProvider.cs similarity index 97% rename from PCL.Core/App/Configuration/Storage/YamlFileProvider.cs rename to PCL.CE/Core/App/Configuration/Storage/YamlFileProvider.cs index d9ad4eb28..16a13bde6 100644 --- a/PCL.Core/App/Configuration/Storage/YamlFileProvider.cs +++ b/PCL.CE/Core/App/Configuration/Storage/YamlFileProvider.cs @@ -3,12 +3,12 @@ using System.IO; using System.Linq; using System.Text; -using PCL.Core.IO; -using PCL.Core.Logging; +using PCL.CE.Core.IO; +using PCL.CE.Core.Logging; using YamlDotNet.RepresentationModel; using YamlDotNet.Serialization; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; /// /// 提供 YAML 格式的键值文件读写。当提供的文件找不到时,将尝试读取其它同名文件并将其转换到 YAML。 diff --git a/PCL.Core/App/Configuration/Storage/YamlNodeConverter.cs b/PCL.CE/Core/App/Configuration/Storage/YamlNodeConverter.cs similarity index 98% rename from PCL.Core/App/Configuration/Storage/YamlNodeConverter.cs rename to PCL.CE/Core/App/Configuration/Storage/YamlNodeConverter.cs index d51f8fb63..7ae29d308 100644 --- a/PCL.Core/App/Configuration/Storage/YamlNodeConverter.cs +++ b/PCL.CE/Core/App/Configuration/Storage/YamlNodeConverter.cs @@ -4,7 +4,7 @@ using YamlDotNet.Core.Events; using YamlDotNet.RepresentationModel; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; // 修改自: https://dotnetfiddle.net/jaG1i1 // 来源: https://stackoverflow.com/a/40727087 diff --git a/PCL.Core/App/Configuration/Storage/YamlNodeEmitter.cs b/PCL.CE/Core/App/Configuration/Storage/YamlNodeEmitter.cs similarity index 99% rename from PCL.Core/App/Configuration/Storage/YamlNodeEmitter.cs rename to PCL.CE/Core/App/Configuration/Storage/YamlNodeEmitter.cs index f0ac24e10..e344570cd 100644 --- a/PCL.Core/App/Configuration/Storage/YamlNodeEmitter.cs +++ b/PCL.CE/Core/App/Configuration/Storage/YamlNodeEmitter.cs @@ -4,7 +4,7 @@ using YamlDotNet.Core.Events; using YamlDotNet.RepresentationModel; -namespace PCL.Core.App.Configuration.Storage; +namespace PCL.CE.Core.App.Configuration.Storage; // Partly generated by gpt-5 (20250903) public sealed class YamlNodeEmitter : IEmitter diff --git a/PCL.Core/App/Database/DatabaseEntry.cs b/PCL.CE/Core/App/Database/DatabaseEntry.cs similarity index 97% rename from PCL.Core/App/Database/DatabaseEntry.cs rename to PCL.CE/Core/App/Database/DatabaseEntry.cs index 8594cc91f..40ccd1c3a 100644 --- a/PCL.Core/App/Database/DatabaseEntry.cs +++ b/PCL.CE/Core/App/Database/DatabaseEntry.cs @@ -1,7 +1,7 @@ using System; using LiteDB; -namespace PCL.Core.App.Database; +namespace PCL.CE.Core.App.Database; /// /// Base database connention entry. diff --git a/PCL.Core/App/Database/DatabaseService.cs b/PCL.CE/Core/App/Database/DatabaseService.cs similarity index 94% rename from PCL.Core/App/Database/DatabaseService.cs rename to PCL.CE/Core/App/Database/DatabaseService.cs index ec9a1a926..956c55e5b 100644 --- a/PCL.Core/App/Database/DatabaseService.cs +++ b/PCL.CE/Core/App/Database/DatabaseService.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Concurrent; using LiteDB; -using PCL.Core.App.IoC; +using PCL.CE.Core.App.IoC; -namespace PCL.Core.App.Database; +namespace PCL.CE.Core.App.Database; [LifecycleService(LifecycleState.Loading)] public class DatabaseService() : GeneralService("database", "数据库管理") diff --git a/PCL.Core/App/Database/README.md b/PCL.CE/Core/App/Database/README.md similarity index 100% rename from PCL.Core/App/Database/README.md rename to PCL.CE/Core/App/Database/README.md diff --git a/PCL.Core/App/Essentials/ApplicationService.cs b/PCL.CE/Core/App/Essentials/ApplicationService.cs similarity index 96% rename from PCL.Core/App/Essentials/ApplicationService.cs rename to PCL.CE/Core/App/Essentials/ApplicationService.cs index 4ef662345..eb4ee7bfa 100644 --- a/PCL.Core/App/Essentials/ApplicationService.cs +++ b/PCL.CE/Core/App/Essentials/ApplicationService.cs @@ -2,9 +2,9 @@ using System.Threading; using System.Windows; using System.Windows.Threading; -using PCL.Core.App.IoC; +using PCL.CE.Core.App.IoC; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; [LifecycleService(LifecycleState.BeforeLoading, Priority = int.MinValue)] [LifecycleScope("application", "应用程序", false)] diff --git a/PCL.Core/App/Essentials/MainWindowService.cs b/PCL.CE/Core/App/Essentials/MainWindowService.cs similarity index 92% rename from PCL.Core/App/Essentials/MainWindowService.cs rename to PCL.CE/Core/App/Essentials/MainWindowService.cs index 937809ea4..e73d86ea2 100644 --- a/PCL.Core/App/Essentials/MainWindowService.cs +++ b/PCL.CE/Core/App/Essentials/MainWindowService.cs @@ -1,8 +1,8 @@ using System; using System.Windows; -using PCL.Core.App.IoC; +using PCL.CE.Core.App.IoC; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; [LifecycleService(LifecycleState.WindowCreating, Priority = int.MaxValue)] public sealed class MainWindowService : GeneralService diff --git a/PCL.Core/App/Essentials/PromoteService.cs b/PCL.CE/Core/App/Essentials/PromoteService.cs similarity index 98% rename from PCL.Core/App/Essentials/PromoteService.cs rename to PCL.CE/Core/App/Essentials/PromoteService.cs index 804979b67..4e34d18dd 100644 --- a/PCL.Core/App/Essentials/PromoteService.cs +++ b/PCL.CE/Core/App/Essentials/PromoteService.cs @@ -6,12 +6,12 @@ using System.IO.Pipes; using System.Text.Json; using System.Threading; -using PCL.Core.App.IoC; -using PCL.Core.IO; -using PCL.Core.Logging; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.IO; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.OS; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; public delegate string? PromoteOperationFunction(string? arg); diff --git a/PCL.Core/App/Essentials/RpcFunction.cs b/PCL.CE/Core/App/Essentials/RpcFunction.cs similarity index 87% rename from PCL.Core/App/Essentials/RpcFunction.cs rename to PCL.CE/Core/App/Essentials/RpcFunction.cs index 2378270b1..55b9ff7fb 100644 --- a/PCL.Core/App/Essentials/RpcFunction.cs +++ b/PCL.CE/Core/App/Essentials/RpcFunction.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; /// /// RPC 函数
diff --git a/PCL.Core/App/Essentials/RpcProperty.cs b/PCL.CE/Core/App/Essentials/RpcProperty.cs similarity index 97% rename from PCL.Core/App/Essentials/RpcProperty.cs rename to PCL.CE/Core/App/Essentials/RpcProperty.cs index 45582b752..8b0c47a20 100644 --- a/PCL.Core/App/Essentials/RpcProperty.cs +++ b/PCL.CE/Core/App/Essentials/RpcProperty.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; public class RpcPropertyOperationFailedException : Exception; diff --git a/PCL.Core/App/Essentials/RpcResponse.cs b/PCL.CE/Core/App/Essentials/RpcResponse.cs similarity index 98% rename from PCL.Core/App/Essentials/RpcResponse.cs rename to PCL.CE/Core/App/Essentials/RpcResponse.cs index f5412b15c..1e2fe609d 100644 --- a/PCL.Core/App/Essentials/RpcResponse.cs +++ b/PCL.CE/Core/App/Essentials/RpcResponse.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; public enum RpcResponseStatus { diff --git a/PCL.Core/App/Essentials/RpcService.cs b/PCL.CE/Core/App/Essentials/RpcService.cs similarity index 99% rename from PCL.Core/App/Essentials/RpcService.cs rename to PCL.CE/Core/App/Essentials/RpcService.cs index 86540b217..3147aad3d 100644 --- a/PCL.Core/App/Essentials/RpcService.cs +++ b/PCL.CE/Core/App/Essentials/RpcService.cs @@ -7,10 +7,10 @@ using System.Text; using System.Threading.Tasks; using System.Windows; -using PCL.Core.App.IoC; -using PCL.Core.IO; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.IO; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; /// /// 用于终止 Pipe RPC 执行过程并返回错误信息的异常
diff --git a/PCL.Core/App/Essentials/SingleInstanceService.cs b/PCL.CE/Core/App/Essentials/SingleInstanceService.cs similarity index 96% rename from PCL.Core/App/Essentials/SingleInstanceService.cs rename to PCL.CE/Core/App/Essentials/SingleInstanceService.cs index 134d30e47..1e4c3979f 100644 --- a/PCL.Core/App/Essentials/SingleInstanceService.cs +++ b/PCL.CE/Core/App/Essentials/SingleInstanceService.cs @@ -3,10 +3,10 @@ using System.IO.Pipes; using System.Text; using System.Text.Json; -using PCL.Core.App.IoC; -using PCL.Core.IO; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.IO; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; [LifecycleService(LifecycleState.BeforeLoading, Priority = -2134567890)] [LifecycleScope("single-instance", "单例", false)] diff --git a/PCL.Core/App/Essentials/StartupService.cs b/PCL.CE/Core/App/Essentials/StartupService.cs similarity index 97% rename from PCL.Core/App/Essentials/StartupService.cs rename to PCL.CE/Core/App/Essentials/StartupService.cs index 2851251eb..0141438c4 100644 --- a/PCL.Core/App/Essentials/StartupService.cs +++ b/PCL.CE/Core/App/Essentials/StartupService.cs @@ -6,12 +6,12 @@ using System.Text; using System.Text.Json; using System.Threading.Tasks; -using PCL.Core.App.Cli; -using PCL.Core.App.IoC; -using PCL.Core.Utils.OS; -using PCL.Core.Utils.Secret; +using PCL.CE.Core.App.Cli; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Core.Utils.Secret; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; /// /// 命令处理委托 diff --git a/PCL.Core/App/Essentials/TelemetryService.cs b/PCL.CE/Core/App/Essentials/TelemetryService.cs similarity index 97% rename from PCL.Core/App/Essentials/TelemetryService.cs rename to PCL.CE/Core/App/Essentials/TelemetryService.cs index 1f6f35fe4..3334abadc 100644 --- a/PCL.Core/App/Essentials/TelemetryService.cs +++ b/PCL.CE/Core/App/Essentials/TelemetryService.cs @@ -8,16 +8,16 @@ using System.Text.Json.Serialization; using System.Threading.Tasks; using Microsoft.Win32; -using PCL.Core.App.IoC; -using PCL.Core.IO.Net; -using PCL.Core.IO.Net.Dns; -using PCL.Core.Logging; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.IO.Net; +using PCL.CE.Core.IO.Net.Dns; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.OS; using STUN.Client; using Sentry; using Sentry.Extensibility; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; [LifecycleScope("telemetry", "遥测")] [LifecycleService(LifecycleState.Running)] diff --git a/PCL.Core/App/Essentials/UpdateHelper.cs b/PCL.CE/Core/App/Essentials/UpdateHelper.cs similarity index 98% rename from PCL.Core/App/Essentials/UpdateHelper.cs rename to PCL.CE/Core/App/Essentials/UpdateHelper.cs index a9604194f..c8d8c4339 100644 --- a/PCL.Core/App/Essentials/UpdateHelper.cs +++ b/PCL.CE/Core/App/Essentials/UpdateHelper.cs @@ -2,7 +2,7 @@ using System.IO; using System.Threading; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; public static class UpdateHelper { diff --git a/PCL.Core/App/Essentials/UpdateService.cs b/PCL.CE/Core/App/Essentials/UpdateService.cs similarity index 96% rename from PCL.Core/App/Essentials/UpdateService.cs rename to PCL.CE/Core/App/Essentials/UpdateService.cs index 1fe6f09b7..bd368bef7 100644 --- a/PCL.Core/App/Essentials/UpdateService.cs +++ b/PCL.CE/Core/App/Essentials/UpdateService.cs @@ -1,10 +1,10 @@ using System; using System.Diagnostics; using System.IO; -using PCL.Core.App.IoC; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.App.Essentials; +namespace PCL.CE.Core.App.Essentials; [LifecycleService(LifecycleState.BeforeLoading)] public sealed class UpdateService : GeneralService diff --git a/PCL.Core/App/IoC/Attributes.cs b/PCL.CE/Core/App/IoC/Attributes.cs similarity index 97% rename from PCL.Core/App/IoC/Attributes.cs rename to PCL.CE/Core/App/IoC/Attributes.cs index 2c9b3ced4..981650c60 100644 --- a/PCL.Core/App/IoC/Attributes.cs +++ b/PCL.CE/Core/App/IoC/Attributes.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; /// /// 注册生命周期服务项,将由生命周期管理统一创建实例,然后在指定生命周期自动启动或加入等待手动启动列表。
@@ -67,7 +67,7 @@ public sealed class LifecycleStopAttribute : Attribute; /// /// 标记一个命令处理器,可以标记多个,将自动识别和处理方法参数。
-/// 若方法的第一个参数类型为 则会传入指定指令的命令行模型。
+/// 若方法的第一个参数类型为 则会传入指定指令的命令行模型。
/// 除命令行模型以外,任何参数在未显式声明默认值时均默认传入 值,请尽可能为所有参数提供显式默认值。
/// NOTE: 请勿使用异步实现,返回 Task 的方法将被直接忽略。
/// NOTE: 该方法可能在任意线程被调用,请注意线程上下文和同步问题。 diff --git a/PCL.Core/App/IoC/DependencyArguments.cs b/PCL.CE/Core/App/IoC/DependencyArguments.cs similarity index 77% rename from PCL.Core/App/IoC/DependencyArguments.cs rename to PCL.CE/Core/App/IoC/DependencyArguments.cs index 307ab1955..a07aaeb4d 100644 --- a/PCL.Core/App/IoC/DependencyArguments.cs +++ b/PCL.CE/Core/App/IoC/DependencyArguments.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; public abstract class DependencyArguments { diff --git a/PCL.Core/App/IoC/DependencyGroup.cs b/PCL.CE/Core/App/IoC/DependencyGroup.cs similarity index 97% rename from PCL.Core/App/IoC/DependencyGroup.cs rename to PCL.CE/Core/App/IoC/DependencyGroup.cs index 5f7212165..73b8d0948 100644 --- a/PCL.Core/App/IoC/DependencyGroup.cs +++ b/PCL.CE/Core/App/IoC/DependencyGroup.cs @@ -2,7 +2,7 @@ using System.Collections.Immutable; using System.Threading.Tasks; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; public abstract class DependencyGroup { diff --git a/PCL.Core/App/IoC/DependencyGroups.cs b/PCL.CE/Core/App/IoC/DependencyGroups.cs similarity index 96% rename from PCL.Core/App/IoC/DependencyGroups.cs rename to PCL.CE/Core/App/IoC/DependencyGroups.cs index 891904294..2790541b6 100644 --- a/PCL.Core/App/IoC/DependencyGroups.cs +++ b/PCL.CE/Core/App/IoC/DependencyGroups.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; public static partial class DependencyGroups { diff --git a/PCL.Core/App/IoC/GeneralService.cs b/PCL.CE/Core/App/IoC/GeneralService.cs similarity index 98% rename from PCL.Core/App/IoC/GeneralService.cs rename to PCL.CE/Core/App/IoC/GeneralService.cs index 6b2b14026..1765473f4 100644 --- a/PCL.Core/App/IoC/GeneralService.cs +++ b/PCL.CE/Core/App/IoC/GeneralService.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; /// /// General service class for constructing in a more convenient way. diff --git a/PCL.Core/App/IoC/Lifecycle.cs b/PCL.CE/Core/App/IoC/Lifecycle.cs similarity index 95% rename from PCL.Core/App/IoC/Lifecycle.cs rename to PCL.CE/Core/App/IoC/Lifecycle.cs index 00c136028..bc7fb279d 100644 --- a/PCL.Core/App/IoC/Lifecycle.cs +++ b/PCL.CE/Core/App/IoC/Lifecycle.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; /// /// 启动器生命周期管理 diff --git a/PCL.Core/App/IoC/LifecycleContext.cs b/PCL.CE/Core/App/IoC/LifecycleContext.cs similarity index 99% rename from PCL.Core/App/IoC/LifecycleContext.cs rename to PCL.CE/Core/App/IoC/LifecycleContext.cs index dc583dac1..621689e16 100644 --- a/PCL.Core/App/IoC/LifecycleContext.cs +++ b/PCL.CE/Core/App/IoC/LifecycleContext.cs @@ -1,8 +1,8 @@ using System; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; partial class Lifecycle { diff --git a/PCL.Core/App/IoC/LifecycleFlow.cs b/PCL.CE/Core/App/IoC/LifecycleFlow.cs similarity index 99% rename from PCL.Core/App/IoC/LifecycleFlow.cs rename to PCL.CE/Core/App/IoC/LifecycleFlow.cs index db1be79d5..561b786b6 100644 --- a/PCL.Core/App/IoC/LifecycleFlow.cs +++ b/PCL.CE/Core/App/IoC/LifecycleFlow.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using System.Windows; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; partial class Lifecycle { diff --git a/PCL.Core/App/IoC/LifecycleLogs.cs b/PCL.CE/Core/App/IoC/LifecycleLogs.cs similarity index 98% rename from PCL.Core/App/IoC/LifecycleLogs.cs rename to PCL.CE/Core/App/IoC/LifecycleLogs.cs index 7dd99efdf..40420740f 100644 --- a/PCL.Core/App/IoC/LifecycleLogs.cs +++ b/PCL.CE/Core/App/IoC/LifecycleLogs.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; partial class Lifecycle { diff --git a/PCL.Core/App/IoC/LifecycleProcess.cs b/PCL.CE/Core/App/IoC/LifecycleProcess.cs similarity index 95% rename from PCL.Core/App/IoC/LifecycleProcess.cs rename to PCL.CE/Core/App/IoC/LifecycleProcess.cs index fa898f80a..8c3831bc3 100644 --- a/PCL.Core/App/IoC/LifecycleProcess.cs +++ b/PCL.CE/Core/App/IoC/LifecycleProcess.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; partial class Lifecycle { diff --git a/PCL.Core/App/IoC/LifecycleService.cs b/PCL.CE/Core/App/IoC/LifecycleService.cs similarity index 99% rename from PCL.Core/App/IoC/LifecycleService.cs rename to PCL.CE/Core/App/IoC/LifecycleService.cs index 8af28fd56..7a2cd8cec 100644 --- a/PCL.Core/App/IoC/LifecycleService.cs +++ b/PCL.CE/Core/App/IoC/LifecycleService.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; partial class Lifecycle { diff --git a/PCL.Core/App/IoC/LifecycleState.cs b/PCL.CE/Core/App/IoC/LifecycleState.cs similarity index 99% rename from PCL.Core/App/IoC/LifecycleState.cs rename to PCL.CE/Core/App/IoC/LifecycleState.cs index f28e47e75..55cdcae3a 100644 --- a/PCL.Core/App/IoC/LifecycleState.cs +++ b/PCL.CE/Core/App/IoC/LifecycleState.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; partial class Lifecycle { diff --git a/PCL.Core/App/IoC/PropertyAccessor.cs b/PCL.CE/Core/App/IoC/PropertyAccessor.cs similarity index 94% rename from PCL.Core/App/IoC/PropertyAccessor.cs rename to PCL.CE/Core/App/IoC/PropertyAccessor.cs index 5d85fc2f2..9f5b5c86e 100644 --- a/PCL.Core/App/IoC/PropertyAccessor.cs +++ b/PCL.CE/Core/App/IoC/PropertyAccessor.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.App.IoC; +namespace PCL.CE.Core.App.IoC; public class PropertyAccessor(Func? getter = null, Action? setter = null) { diff --git a/PCL.Core/App/Metadata.cs b/PCL.CE/Core/App/Metadata.cs similarity index 98% rename from PCL.Core/App/Metadata.cs rename to PCL.CE/Core/App/Metadata.cs index 8f87b0a27..c4d872d6f 100644 --- a/PCL.Core/App/Metadata.cs +++ b/PCL.CE/Core/App/Metadata.cs @@ -1,7 +1,7 @@ using System.Text.Json.Serialization; -using PCL.Core.Utils.OS; +using PCL.CE.Core.Utils.OS; -namespace PCL.Core.App; +namespace PCL.CE.Core.App; /// /// 启动器版本信息模型 diff --git a/PCL.Core/App/Paths.cs b/PCL.CE/Core/App/Paths.cs similarity index 98% rename from PCL.Core/App/Paths.cs rename to PCL.CE/Core/App/Paths.cs index a9420aaf1..b69daaba0 100644 --- a/PCL.Core/App/Paths.cs +++ b/PCL.CE/Core/App/Paths.cs @@ -1,9 +1,9 @@ using System; using System.IO; -using PCL.Core.Utils.OS; +using PCL.CE.Core.Utils.OS; using Special = System.Environment.SpecialFolder; -namespace PCL.Core.App; +namespace PCL.CE.Core.App; /// /// Application global paths.
diff --git a/PCL.Core/App/Secrets.cs b/PCL.CE/Core/App/Secrets.cs similarity index 93% rename from PCL.Core/App/Secrets.cs rename to PCL.CE/Core/App/Secrets.cs index 8c0b91edf..ac461e215 100644 --- a/PCL.Core/App/Secrets.cs +++ b/PCL.CE/Core/App/Secrets.cs @@ -1,43 +1,43 @@ -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.OS; - -namespace PCL.Core.App; - -// ReSharper disable InconsistentNaming -public static class Secrets -{ - /// - /// 微软 OAuth 的 Client ID - /// - public static string MSOAuthClientId { get; } = EnvironmentInterop.GetSecret("MS_CLIENT_ID", readEnvDebugOnly: true).ReplaceNullOrEmpty(); - - /// - /// CurseForge API 的 Client ID - /// - public static string CurseForgeAPIKey { get; } = EnvironmentInterop.GetSecret("CURSEFORGE_API_KEY", readEnvDebugOnly: true).ReplaceNullOrEmpty(); - - /// - /// 遥测密钥 - /// - public static string TelemetryKey { get; } = EnvironmentInterop.GetSecret("TELEMETRY_KEY", readEnvDebugOnly: true).ReplaceNullOrEmpty(); - - /// - /// Natayark ID OAuth 的 Client ID - /// - public static string NatayarkClientId { get; } = EnvironmentInterop.GetSecret("NAID_CLIENT_ID", readEnvDebugOnly: true).ReplaceNullOrEmpty(); - - /// - /// Natayark ID OAuth 的 Client ID - /// - public static string NatayarkClientSecret { get; } = EnvironmentInterop.GetSecret("NAID_CLIENT_SECRET", readEnvDebugOnly: true).ReplaceNullOrEmpty(); - - /// - /// 联机根服务器 - /// - public static string[] LinkServers { get; } = EnvironmentInterop.GetSecret("LINK_SERVER_ROOT", readEnvDebugOnly: true).ReplaceNullOrEmpty().Split("|"); - - /// - /// 当前版本的 Git 提交 SHA - /// - public static string CommitHash { get; } = EnvironmentInterop.GetSecret("GITHUB_SHA", readEnvDebugOnly: true).ReplaceNullOrEmpty(); -} +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.OS; + +namespace PCL.CE.Core.App; + +// ReSharper disable InconsistentNaming +public static class Secrets +{ + /// + /// 微软 OAuth 的 Client ID + /// + public static string MSOAuthClientId { get; } = EnvironmentInterop.GetSecret("MS_CLIENT_ID", readEnvDebugOnly: true).ReplaceNullOrEmpty(); + + /// + /// CurseForge API 的 Client ID + /// + public static string CurseForgeAPIKey { get; } = EnvironmentInterop.GetSecret("CURSEFORGE_API_KEY", readEnvDebugOnly: true).ReplaceNullOrEmpty(); + + /// + /// 遥测密钥 + /// + public static string TelemetryKey { get; } = EnvironmentInterop.GetSecret("TELEMETRY_KEY", readEnvDebugOnly: true).ReplaceNullOrEmpty(); + + /// + /// Natayark ID OAuth 的 Client ID + /// + public static string NatayarkClientId { get; } = EnvironmentInterop.GetSecret("NAID_CLIENT_ID", readEnvDebugOnly: true).ReplaceNullOrEmpty(); + + /// + /// Natayark ID OAuth 的 Client ID + /// + public static string NatayarkClientSecret { get; } = EnvironmentInterop.GetSecret("NAID_CLIENT_SECRET", readEnvDebugOnly: true).ReplaceNullOrEmpty(); + + /// + /// 联机根服务器 + /// + public static string[] LinkServers { get; } = EnvironmentInterop.GetSecret("LINK_SERVER_ROOT", readEnvDebugOnly: true).ReplaceNullOrEmpty().Split("|"); + + /// + /// 当前版本的 Git 提交 SHA + /// + public static string CommitHash { get; } = EnvironmentInterop.GetSecret("GITHUB_SHA", readEnvDebugOnly: true).ReplaceNullOrEmpty(); +} diff --git a/PCL.Core/App/States.cs b/PCL.CE/Core/App/States.cs similarity index 99% rename from PCL.Core/App/States.cs rename to PCL.CE/Core/App/States.cs index fe226e403..baa960aca 100644 --- a/PCL.Core/App/States.cs +++ b/PCL.CE/Core/App/States.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using PCL.Core.App.Configuration; +using PCL.CE.Core.App.Configuration; -namespace PCL.Core.App; +namespace PCL.CE.Core.App; /// /// 全局状态类。 diff --git a/PCL.Core/App/Tasks/ITask.cs b/PCL.CE/Core/App/Tasks/ITask.cs similarity index 96% rename from PCL.Core/App/Tasks/ITask.cs rename to PCL.CE/Core/App/Tasks/ITask.cs index 06f4e1e65..1a84d99f9 100644 --- a/PCL.Core/App/Tasks/ITask.cs +++ b/PCL.CE/Core/App/Tasks/ITask.cs @@ -1,7 +1,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; /// /// 任务状态改变事件 diff --git a/PCL.Core/App/Tasks/ITaskCancelable.cs b/PCL.CE/Core/App/Tasks/ITaskCancelable.cs similarity index 79% rename from PCL.Core/App/Tasks/ITaskCancelable.cs rename to PCL.CE/Core/App/Tasks/ITaskCancelable.cs index 8019c15b2..f8435b870 100644 --- a/PCL.Core/App/Tasks/ITaskCancelable.cs +++ b/PCL.CE/Core/App/Tasks/ITaskCancelable.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; /// /// 用于取消实现的接口 diff --git a/PCL.Core/App/Tasks/ITaskGroup.cs b/PCL.CE/Core/App/Tasks/ITaskGroup.cs similarity index 84% rename from PCL.Core/App/Tasks/ITaskGroup.cs rename to PCL.CE/Core/App/Tasks/ITaskGroup.cs index c4f5f1fd8..b432456af 100644 --- a/PCL.Core/App/Tasks/ITaskGroup.cs +++ b/PCL.CE/Core/App/Tasks/ITaskGroup.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; public delegate void TaskGroupEvent(ITask task); diff --git a/PCL.Core/App/Tasks/ITaskPausable.cs b/PCL.CE/Core/App/Tasks/ITaskPausable.cs similarity index 78% rename from PCL.Core/App/Tasks/ITaskPausable.cs rename to PCL.CE/Core/App/Tasks/ITaskPausable.cs index 5b0c5c10a..4b7cfb264 100644 --- a/PCL.Core/App/Tasks/ITaskPausable.cs +++ b/PCL.CE/Core/App/Tasks/ITaskPausable.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; /// /// 用于暂停实现的接口 diff --git a/PCL.Core/App/Tasks/ITaskProgressive.cs b/PCL.CE/Core/App/Tasks/ITaskProgressive.cs similarity index 92% rename from PCL.Core/App/Tasks/ITaskProgressive.cs rename to PCL.CE/Core/App/Tasks/ITaskProgressive.cs index d513c7eeb..eea5c8720 100644 --- a/PCL.Core/App/Tasks/ITaskProgressive.cs +++ b/PCL.CE/Core/App/Tasks/ITaskProgressive.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; /// /// 任务进度改变事件 diff --git a/PCL.Core/App/Tasks/TaskCenter.cs b/PCL.CE/Core/App/Tasks/TaskCenter.cs similarity index 98% rename from PCL.Core/App/Tasks/TaskCenter.cs rename to PCL.CE/Core/App/Tasks/TaskCenter.cs index 972efa770..8da87c5c3 100644 --- a/PCL.Core/App/Tasks/TaskCenter.cs +++ b/PCL.CE/Core/App/Tasks/TaskCenter.cs @@ -3,9 +3,9 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; /// /// 任务中心,用于管理任务 diff --git a/PCL.Core/App/Tasks/TaskModel.cs b/PCL.CE/Core/App/Tasks/TaskModel.cs similarity index 98% rename from PCL.Core/App/Tasks/TaskModel.cs rename to PCL.CE/Core/App/Tasks/TaskModel.cs index 9f01e1a5e..bd4e959f6 100644 --- a/PCL.Core/App/Tasks/TaskModel.cs +++ b/PCL.CE/Core/App/Tasks/TaskModel.cs @@ -4,7 +4,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; /// /// 可观察的任务模型
diff --git a/PCL.Core/App/Tasks/TaskState.cs b/PCL.CE/Core/App/Tasks/TaskState.cs similarity index 71% rename from PCL.Core/App/Tasks/TaskState.cs rename to PCL.CE/Core/App/Tasks/TaskState.cs index 50d24291e..69328af2b 100644 --- a/PCL.Core/App/Tasks/TaskState.cs +++ b/PCL.CE/Core/App/Tasks/TaskState.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.App.Tasks; +namespace PCL.CE.Core.App.Tasks; public enum TaskState { diff --git a/PCL.Core/App/Tools/DependencyCheckService.cs b/PCL.CE/Core/App/Tools/DependencyCheckService.cs similarity index 97% rename from PCL.Core/App/Tools/DependencyCheckService.cs rename to PCL.CE/Core/App/Tools/DependencyCheckService.cs index 0254a81b2..b90418ab1 100644 --- a/PCL.Core/App/Tools/DependencyCheckService.cs +++ b/PCL.CE/Core/App/Tools/DependencyCheckService.cs @@ -1,5 +1,5 @@ -using PCL.Core.App.IoC; -using PCL.Core.UI; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.UI; using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -7,7 +7,7 @@ using System.Text.Json.Nodes; using System.Threading.Tasks; -namespace PCL.Core.App.Tools; +namespace PCL.CE.Core.App.Tools; [LifecycleScope("dependency-check", "依赖检查")] [LifecycleService(LifecycleState.Running)] diff --git a/PCL.Core/App/Tools/MemSwapService.cs b/PCL.CE/Core/App/Tools/MemSwapService.cs similarity index 95% rename from PCL.Core/App/Tools/MemSwapService.cs rename to PCL.CE/Core/App/Tools/MemSwapService.cs index ca7b5fbd9..ac6bd7f69 100644 --- a/PCL.Core/App/Tools/MemSwapService.cs +++ b/PCL.CE/Core/App/Tools/MemSwapService.cs @@ -1,13 +1,13 @@ -using PCL.Core.App.IoC; -using PCL.Core.IO; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.IO; +using PCL.CE.Core.Utils.OS; using System; using System.Threading; -using PCL.Core.App.Essentials; -using PCL.Core.Logging; -using PCL.Core.UI; +using PCL.CE.Core.App.Essentials; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; -namespace PCL.Core.App.Tools; +namespace PCL.CE.Core.App.Tools; [LifecycleService(LifecycleState.Running)] [LifecycleScope("mem-swap", "内存交换", false)] diff --git a/PCL.Core/App/Tools/MemSwapWorks.cs b/PCL.CE/Core/App/Tools/MemSwapWorks.cs similarity index 98% rename from PCL.Core/App/Tools/MemSwapWorks.cs rename to PCL.CE/Core/App/Tools/MemSwapWorks.cs index 945d3b14e..d7f35aa73 100644 --- a/PCL.Core/App/Tools/MemSwapWorks.cs +++ b/PCL.CE/Core/App/Tools/MemSwapWorks.cs @@ -1,8 +1,8 @@ using System; using System.Runtime.InteropServices; -using PCL.Core.Utils.OS; +using PCL.CE.Core.Utils.OS; -namespace PCL.Core.App.Tools; +namespace PCL.CE.Core.App.Tools; [Flags] public enum MemSwapScope diff --git a/PCL.Core/IO/ByteStream.cs b/PCL.CE/Core/IO/ByteStream.cs similarity index 98% rename from PCL.Core/IO/ByteStream.cs rename to PCL.CE/Core/IO/ByteStream.cs index 2a8361980..514431cd8 100644 --- a/PCL.Core/IO/ByteStream.cs +++ b/PCL.CE/Core/IO/ByteStream.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace PCL.Core.IO; +namespace PCL.CE.Core.IO; public class ByteStream(Stream stream) { diff --git a/PCL.Core/IO/Directories.cs b/PCL.CE/Core/IO/Directories.cs similarity index 99% rename from PCL.Core/IO/Directories.cs rename to PCL.CE/Core/IO/Directories.cs index 90c338069..de0c8faec 100644 --- a/PCL.Core/IO/Directories.cs +++ b/PCL.CE/Core/IO/Directories.cs @@ -1,6 +1,6 @@ using System.Security.AccessControl; -namespace PCL.Core.IO; +namespace PCL.CE.Core.IO; using System; using System.Collections.Generic; diff --git a/PCL.Core/IO/Download/IDlConnection.cs b/PCL.CE/Core/IO/Download/IDlConnection.cs similarity index 96% rename from PCL.Core/IO/Download/IDlConnection.cs rename to PCL.CE/Core/IO/Download/IDlConnection.cs index ea88e1535..5dbf509d7 100644 --- a/PCL.Core/IO/Download/IDlConnection.cs +++ b/PCL.CE/Core/IO/Download/IDlConnection.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; /// /// 下载连接,负责与服务器进行通信。 diff --git a/PCL.Core/IO/Download/IDlResourceMapping.cs b/PCL.CE/Core/IO/Download/IDlResourceMapping.cs similarity index 85% rename from PCL.Core/IO/Download/IDlResourceMapping.cs rename to PCL.CE/Core/IO/Download/IDlResourceMapping.cs index 84d331802..f6ce60cf7 100644 --- a/PCL.Core/IO/Download/IDlResourceMapping.cs +++ b/PCL.CE/Core/IO/Download/IDlResourceMapping.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; /// /// 资源 ID 映射。 diff --git a/PCL.Core/IO/Download/IDlWriter.cs b/PCL.CE/Core/IO/Download/IDlWriter.cs similarity index 95% rename from PCL.Core/IO/Download/IDlWriter.cs rename to PCL.CE/Core/IO/Download/IDlWriter.cs index f0b561048..3901978ff 100644 --- a/PCL.Core/IO/Download/IDlWriter.cs +++ b/PCL.CE/Core/IO/Download/IDlWriter.cs @@ -1,7 +1,7 @@ using System.IO; using System.Threading.Tasks; -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; /// /// 下载写入器。 diff --git a/PCL.Core/IO/Download/NDlConnectionInfo.cs b/PCL.CE/Core/IO/Download/NDlConnectionInfo.cs similarity index 91% rename from PCL.Core/IO/Download/NDlConnectionInfo.cs rename to PCL.CE/Core/IO/Download/NDlConnectionInfo.cs index ef1e07a37..7ac839708 100644 --- a/PCL.Core/IO/Download/NDlConnectionInfo.cs +++ b/PCL.CE/Core/IO/Download/NDlConnectionInfo.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; /// /// 下载连接信息。 diff --git a/PCL.Core/IO/Download/NDlFactory.cs b/PCL.CE/Core/IO/Download/NDlFactory.cs similarity index 98% rename from PCL.Core/IO/Download/NDlFactory.cs rename to PCL.CE/Core/IO/Download/NDlFactory.cs index 76764b435..d7b91278e 100644 --- a/PCL.Core/IO/Download/NDlFactory.cs +++ b/PCL.CE/Core/IO/Download/NDlFactory.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; /// /// 无泛型的下载器构建工厂。 diff --git a/PCL.CE/Core/IO/Download/NDlScheduler.cs b/PCL.CE/Core/IO/Download/NDlScheduler.cs new file mode 100644 index 000000000..3ab4c0b2b --- /dev/null +++ b/PCL.CE/Core/IO/Download/NDlScheduler.cs @@ -0,0 +1,5 @@ +namespace PCL.CE.Core.IO.Download; + +public class NDlScheduler +{ +} diff --git a/PCL.Core/IO/Download/NDlSourceManager.cs b/PCL.CE/Core/IO/Download/NDlSourceManager.cs similarity index 91% rename from PCL.Core/IO/Download/NDlSourceManager.cs rename to PCL.CE/Core/IO/Download/NDlSourceManager.cs index 4f7d9e574..a56e947a8 100644 --- a/PCL.Core/IO/Download/NDlSourceManager.cs +++ b/PCL.CE/Core/IO/Download/NDlSourceManager.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; public class NDlSourceManager(IList> sources) : IDlResourceMapping diff --git a/PCL.Core/IO/Download/NDlSourceReport.cs b/PCL.CE/Core/IO/Download/NDlSourceReport.cs similarity index 90% rename from PCL.Core/IO/Download/NDlSourceReport.cs rename to PCL.CE/Core/IO/Download/NDlSourceReport.cs index f911fce39..c002dfb25 100644 --- a/PCL.Core/IO/Download/NDlSourceReport.cs +++ b/PCL.CE/Core/IO/Download/NDlSourceReport.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.IO.Download; +namespace PCL.CE.Core.IO.Download; /// /// 下载源质量报告 diff --git a/PCL.CE/Core/IO/Download/NDlTask.cs b/PCL.CE/Core/IO/Download/NDlTask.cs new file mode 100644 index 000000000..6020b7358 --- /dev/null +++ b/PCL.CE/Core/IO/Download/NDlTask.cs @@ -0,0 +1,5 @@ +namespace PCL.CE.Core.IO.Download; + +public class NDlTask +{ +} diff --git a/PCL.CE/Core/IO/Download/NDlTaskSegment.cs b/PCL.CE/Core/IO/Download/NDlTaskSegment.cs new file mode 100644 index 000000000..57272537e --- /dev/null +++ b/PCL.CE/Core/IO/Download/NDlTaskSegment.cs @@ -0,0 +1,5 @@ +namespace PCL.CE.Core.IO.Download; + +public class NDlTaskSegment +{ +} diff --git a/PCL.Core/IO/Files.cs b/PCL.CE/Core/IO/Files.cs similarity index 99% rename from PCL.Core/IO/Files.cs rename to PCL.CE/Core/IO/Files.cs index a7ba6564c..f1e438584 100644 --- a/PCL.Core/IO/Files.cs +++ b/PCL.CE/Core/IO/Files.cs @@ -2,11 +2,11 @@ using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.Tar; using ICSharpCode.SharpZipLib.Zip; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.Utils.Codecs; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.Hash; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.Codecs; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.Hash; using System; using System.Collections.Generic; using System.IO; @@ -17,9 +17,9 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL.Core.IO; +namespace PCL.CE.Core.IO; public static class Files { public static readonly JsonSerializerOptions PrettierJsonOptions = new() { diff --git a/PCL.Core/IO/Net/Dns/DnsQuery.cs b/PCL.CE/Core/IO/Net/Dns/DnsQuery.cs similarity index 96% rename from PCL.Core/IO/Net/Dns/DnsQuery.cs rename to PCL.CE/Core/IO/Net/Dns/DnsQuery.cs index e948a3390..c049e07a4 100644 --- a/PCL.Core/IO/Net/Dns/DnsQuery.cs +++ b/PCL.CE/Core/IO/Net/Dns/DnsQuery.cs @@ -9,10 +9,10 @@ using Ae.Dns.Protocol; using Ae.Dns.Protocol.Enums; using Ae.Dns.Protocol.Records; -using PCL.Core.IO.Net.Http.Client; -using PCL.Core.Logging; +using PCL.CE.Core.IO.Net.Http.Client; +using PCL.CE.Core.Logging; -namespace PCL.Core.IO.Net.Dns; +namespace PCL.CE.Core.IO.Net.Dns; public class DnsQuery : IDisposable { diff --git a/PCL.Core/IO/Net/Dns/DnsSrvResource.cs b/PCL.CE/Core/IO/Net/Dns/DnsSrvResource.cs similarity index 98% rename from PCL.Core/IO/Net/Dns/DnsSrvResource.cs rename to PCL.CE/Core/IO/Net/Dns/DnsSrvResource.cs index a0d69a877..f916798d4 100644 --- a/PCL.Core/IO/Net/Dns/DnsSrvResource.cs +++ b/PCL.CE/Core/IO/Net/Dns/DnsSrvResource.cs @@ -4,7 +4,7 @@ using System.Text; using Ae.Dns.Protocol.Records; -namespace PCL.Core.IO.Net.Dns; +namespace PCL.CE.Core.IO.Net.Dns; public class DnsSrvResource : IDnsResource { diff --git a/PCL.Core/IO/Net/Dns/WeightedDnsRacerClient.cs b/PCL.CE/Core/IO/Net/Dns/WeightedDnsRacerClient.cs similarity index 97% rename from PCL.Core/IO/Net/Dns/WeightedDnsRacerClient.cs rename to PCL.CE/Core/IO/Net/Dns/WeightedDnsRacerClient.cs index 0b4a175a5..5a9da2cad 100644 --- a/PCL.Core/IO/Net/Dns/WeightedDnsRacerClient.cs +++ b/PCL.CE/Core/IO/Net/Dns/WeightedDnsRacerClient.cs @@ -3,9 +3,9 @@ using System.Threading; using System.Threading.Tasks; using Ae.Dns.Protocol; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.IO.Net.Dns; +namespace PCL.CE.Core.IO.Net.Dns; public sealed class WeightedDnsRacerClient : IDnsClient { diff --git a/PCL.Core/IO/Net/Http/HostConnectionHandler.cs b/PCL.CE/Core/IO/Net/Http/HostConnectionHandler.cs similarity index 98% rename from PCL.Core/IO/Net/Http/HostConnectionHandler.cs rename to PCL.CE/Core/IO/Net/Http/HostConnectionHandler.cs index a27351c77..2e187b87d 100644 --- a/PCL.Core/IO/Net/Http/HostConnectionHandler.cs +++ b/PCL.CE/Core/IO/Net/Http/HostConnectionHandler.cs @@ -8,11 +8,11 @@ using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; -using PCL.Core.IO.Net.Dns; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.IO.Net.Dns; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.IO.Net.Http.Client; +namespace PCL.CE.Core.IO.Net.Http.Client; public class HostConnectionHandler { diff --git a/PCL.Core/IO/Net/Http/HttpBasicExtension.cs b/PCL.CE/Core/IO/Net/Http/HttpBasicExtension.cs similarity index 86% rename from PCL.Core/IO/Net/Http/HttpBasicExtension.cs rename to PCL.CE/Core/IO/Net/Http/HttpBasicExtension.cs index 52412c269..b9fc95954 100644 --- a/PCL.Core/IO/Net/Http/HttpBasicExtension.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpBasicExtension.cs @@ -1,7 +1,7 @@ using System; using System.Net.Http; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpBasicExtension { diff --git a/PCL.Core/IO/Net/Http/HttpContentExtension.cs b/PCL.CE/Core/IO/Net/Http/HttpContentExtension.cs similarity index 97% rename from PCL.Core/IO/Net/Http/HttpContentExtension.cs rename to PCL.CE/Core/IO/Net/Http/HttpContentExtension.cs index a1c883db7..17c7b1511 100644 --- a/PCL.Core/IO/Net/Http/HttpContentExtension.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpContentExtension.cs @@ -3,7 +3,7 @@ using System.Text; using System.Text.Json; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpContentExtension { diff --git a/PCL.Core/IO/Net/Http/HttpCookieExtension.cs b/PCL.CE/Core/IO/Net/Http/HttpCookieExtension.cs similarity index 96% rename from PCL.Core/IO/Net/Http/HttpCookieExtension.cs rename to PCL.CE/Core/IO/Net/Http/HttpCookieExtension.cs index ac0052323..027170c62 100644 --- a/PCL.Core/IO/Net/Http/HttpCookieExtension.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpCookieExtension.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Net.Http; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpCookieExtension { diff --git a/PCL.Core/IO/Net/Http/HttpHeaderExtension.cs b/PCL.CE/Core/IO/Net/Http/HttpHeaderExtension.cs similarity index 96% rename from PCL.Core/IO/Net/Http/HttpHeaderExtension.cs rename to PCL.CE/Core/IO/Net/Http/HttpHeaderExtension.cs index b033ece7d..bf8b2b3f3 100644 --- a/PCL.Core/IO/Net/Http/HttpHeaderExtension.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpHeaderExtension.cs @@ -3,7 +3,7 @@ using System.Net.Http; using System.Net.Http.Headers; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpHeaderHandler { diff --git a/PCL.Core/IO/Net/Http/HttpProxyManager.cs b/PCL.CE/Core/IO/Net/Http/HttpProxyManager.cs similarity index 97% rename from PCL.Core/IO/Net/Http/HttpProxyManager.cs rename to PCL.CE/Core/IO/Net/Http/HttpProxyManager.cs index 566f9d9e8..030ba53f8 100644 --- a/PCL.Core/IO/Net/Http/HttpProxyManager.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpProxyManager.cs @@ -1,10 +1,10 @@ using System; using System.Net; using Microsoft.Win32; -using PCL.Core.Logging; -using PCL.Core.Utils.OS; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.OS; -namespace PCL.Core.IO.Net.Http.Client; +namespace PCL.CE.Core.IO.Net.Http.Client; public class HttpProxyManager : IWebProxy, IDisposable { diff --git a/PCL.Core/IO/Net/Http/HttpRequest.cs b/PCL.CE/Core/IO/Net/Http/HttpRequest.cs similarity index 96% rename from PCL.Core/IO/Net/Http/HttpRequest.cs rename to PCL.CE/Core/IO/Net/Http/HttpRequest.cs index e0e0df0d3..617e99ab7 100644 --- a/PCL.Core/IO/Net/Http/HttpRequest.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpRequest.cs @@ -2,7 +2,7 @@ using System.Net.Http; using System.Threading.Tasks; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpRequest { diff --git a/PCL.Core/IO/Net/Http/HttpResponseExtension.cs b/PCL.CE/Core/IO/Net/Http/HttpResponseExtension.cs similarity index 99% rename from PCL.Core/IO/Net/Http/HttpResponseExtension.cs rename to PCL.CE/Core/IO/Net/Http/HttpResponseExtension.cs index 841de1f68..1320ee8b8 100644 --- a/PCL.Core/IO/Net/Http/HttpResponseExtension.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpResponseExtension.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpResponseExtension { diff --git a/PCL.Core/IO/Net/Http/HttpRoute.cs b/PCL.CE/Core/IO/Net/Http/HttpRoute.cs similarity index 84% rename from PCL.Core/IO/Net/Http/HttpRoute.cs rename to PCL.CE/Core/IO/Net/Http/HttpRoute.cs index eaf60c367..976e88507 100644 --- a/PCL.Core/IO/Net/Http/HttpRoute.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpRoute.cs @@ -1,7 +1,7 @@ using System; using System.Net.Http; -namespace PCL.Core.IO.Net.Http; +namespace PCL.CE.Core.IO.Net.Http; public class HttpRoute(HttpMethod method, string path) : Attribute { diff --git a/PCL.Core/IO/Net/Http/HttpRouteResponse.cs b/PCL.CE/Core/IO/Net/Http/HttpRouteResponse.cs similarity index 98% rename from PCL.Core/IO/Net/Http/HttpRouteResponse.cs rename to PCL.CE/Core/IO/Net/Http/HttpRouteResponse.cs index 10b5732c0..d302ed020 100644 --- a/PCL.Core/IO/Net/Http/HttpRouteResponse.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpRouteResponse.cs @@ -4,9 +4,9 @@ using System.Text; using System.Text.Json; using System.Threading.Tasks; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.IO.Net.Http; +namespace PCL.CE.Core.IO.Net.Http; /// /// 用于 响应客户端请求的服务端响应结构。 diff --git a/PCL.Core/IO/Net/Http/HttpSenderExtension.cs b/PCL.CE/Core/IO/Net/Http/HttpSenderExtension.cs similarity index 95% rename from PCL.Core/IO/Net/Http/HttpSenderExtension.cs rename to PCL.CE/Core/IO/Net/Http/HttpSenderExtension.cs index 61221648e..164fb079c 100644 --- a/PCL.Core/IO/Net/Http/HttpSenderExtension.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpSenderExtension.cs @@ -1,12 +1,12 @@ -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.IO.Net.Http.Client.Request; +namespace PCL.CE.Core.IO.Net.Http.Client.Request; public static class HttpSenderExtension { diff --git a/PCL.Core/IO/Net/Http/HttpServer.cs b/PCL.CE/Core/IO/Net/Http/HttpServer.cs similarity index 99% rename from PCL.Core/IO/Net/Http/HttpServer.cs rename to PCL.CE/Core/IO/Net/Http/HttpServer.cs index a1744da67..cadc5a199 100644 --- a/PCL.Core/IO/Net/Http/HttpServer.cs +++ b/PCL.CE/Core/IO/Net/Http/HttpServer.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.IO.Net.Http; +namespace PCL.CE.Core.IO.Net.Http; public abstract class HttpServer : IDisposable { diff --git a/PCL.Core/IO/Net/NetworkHelper.cs b/PCL.CE/Core/IO/Net/NetworkHelper.cs similarity index 94% rename from PCL.Core/IO/Net/NetworkHelper.cs rename to PCL.CE/Core/IO/Net/NetworkHelper.cs index e8938e9bc..af911b87c 100644 --- a/PCL.Core/IO/Net/NetworkHelper.cs +++ b/PCL.CE/Core/IO/Net/NetworkHelper.cs @@ -2,7 +2,7 @@ using System.Net.NetworkInformation; using System.Net.Sockets; -namespace PCL.Core.IO.Net; +namespace PCL.CE.Core.IO.Net; public static class NetworkHelper { diff --git a/PCL.Core/IO/Net/NetworkInterfaceUtils.cs b/PCL.CE/Core/IO/Net/NetworkInterfaceUtils.cs similarity index 98% rename from PCL.Core/IO/Net/NetworkInterfaceUtils.cs rename to PCL.CE/Core/IO/Net/NetworkInterfaceUtils.cs index 195a78e77..625e4a7a3 100644 --- a/PCL.Core/IO/Net/NetworkInterfaceUtils.cs +++ b/PCL.CE/Core/IO/Net/NetworkInterfaceUtils.cs @@ -4,7 +4,7 @@ using System.Net.NetworkInformation; using System.Net.Sockets; -namespace PCL.Core.IO.Net; +namespace PCL.CE.Core.IO.Net; public static class NetworkInterfaceUtils { diff --git a/PCL.Core/IO/Net/NetworkService.cs b/PCL.CE/Core/IO/Net/NetworkService.cs similarity index 95% rename from PCL.Core/IO/Net/NetworkService.cs rename to PCL.CE/Core/IO/Net/NetworkService.cs index 75e79625e..a3e12f5bf 100644 --- a/PCL.Core/IO/Net/NetworkService.cs +++ b/PCL.CE/Core/IO/Net/NetworkService.cs @@ -2,13 +2,13 @@ using System.Net; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; -using PCL.Core.App; -using PCL.Core.App.IoC; -using PCL.Core.IO.Net.Http.Client; -using PCL.Core.Logging; +using PCL.CE.Core.App; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.IO.Net.Http.Client; +using PCL.CE.Core.Logging; using Polly; -namespace PCL.Core.IO.Net; +namespace PCL.CE.Core.IO.Net; [LifecycleService(LifecycleState.Loading)] [LifecycleScope("network", "网络服务")] diff --git a/PCL.Core/IO/Net/SocketExtension.cs b/PCL.CE/Core/IO/Net/SocketExtension.cs similarity index 93% rename from PCL.Core/IO/Net/SocketExtension.cs rename to PCL.CE/Core/IO/Net/SocketExtension.cs index 6fe65ffed..9a24005e8 100644 --- a/PCL.Core/IO/Net/SocketExtension.cs +++ b/PCL.CE/Core/IO/Net/SocketExtension.cs @@ -1,6 +1,6 @@ using System.Net.Sockets; -namespace PCL.Core.IO.Net; +namespace PCL.CE.Core.IO.Net; public static class SocketExtensions { diff --git a/PCL.Core/IO/Net/TcpForward.cs b/PCL.CE/Core/IO/Net/TcpForward.cs similarity index 99% rename from PCL.Core/IO/Net/TcpForward.cs rename to PCL.CE/Core/IO/Net/TcpForward.cs index 1bdd8db03..4ecb24585 100644 --- a/PCL.Core/IO/Net/TcpForward.cs +++ b/PCL.CE/Core/IO/Net/TcpForward.cs @@ -5,9 +5,9 @@ using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.IO.Net; +namespace PCL.CE.Core.IO.Net; public sealed class TcpForward( IPAddress listenAddress, int listenPort, diff --git a/PCL.Core/IO/PipeComm.cs b/PCL.CE/Core/IO/PipeComm.cs similarity index 98% rename from PCL.Core/IO/PipeComm.cs rename to PCL.CE/Core/IO/PipeComm.cs index c7e54160c..6d0e966fd 100644 --- a/PCL.Core/IO/PipeComm.cs +++ b/PCL.CE/Core/IO/PipeComm.cs @@ -4,11 +4,11 @@ using System.IO.Pipes; using System.Linq; using System.Text; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.OS; -namespace PCL.Core.IO; +namespace PCL.CE.Core.IO; public static class PipeComm { diff --git a/PCL.Core/IO/Storage/HashStorage.cs b/PCL.CE/Core/IO/Storage/HashStorage.cs similarity index 97% rename from PCL.Core/IO/Storage/HashStorage.cs rename to PCL.CE/Core/IO/Storage/HashStorage.cs index b4fd1c349..1765406bb 100644 --- a/PCL.Core/IO/Storage/HashStorage.cs +++ b/PCL.CE/Core/IO/Storage/HashStorage.cs @@ -2,11 +2,11 @@ using System.IO; using System.IO.Compression; using System.Threading.Tasks; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.Hash; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.Hash; -namespace PCL.Core.IO.Storage; +namespace PCL.CE.Core.IO.Storage; public class HashStorage(string folder, IHashProvider hashProvider, bool compressObjects = false, bool correctMisplacedFile = true, int prefixLength = 2) { diff --git a/PCL.Core/Link/BroadcastListener.cs b/PCL.CE/Core/Link/BroadcastListener.cs similarity index 98% rename from PCL.Core/Link/BroadcastListener.cs rename to PCL.CE/Core/Link/BroadcastListener.cs index e6948046b..2a5618201 100644 --- a/PCL.Core/Link/BroadcastListener.cs +++ b/PCL.CE/Core/Link/BroadcastListener.cs @@ -1,5 +1,5 @@ -using PCL.Core.Utils; -using PCL.Core.Utils.OS; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.OS; using System; using System.Linq; using System.Net; @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link; +namespace PCL.CE.Core.Link; public class BroadcastListener(bool receiveLocalOnly = true) : IDisposable { diff --git a/PCL.Core/Link/BroadcastLocal.cs b/PCL.CE/Core/Link/BroadcastLocal.cs similarity index 97% rename from PCL.Core/Link/BroadcastLocal.cs rename to PCL.CE/Core/Link/BroadcastLocal.cs index 4e779549d..debe33c56 100644 --- a/PCL.Core/Link/BroadcastLocal.cs +++ b/PCL.CE/Core/Link/BroadcastLocal.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using PCL.Core.IO.Net; +using PCL.CE.Core.IO.Net; -namespace PCL.Core.Link; +namespace PCL.CE.Core.Link; public class BroadcastLocal(string description, int localPort) : IDisposable { diff --git a/PCL.Core/Link/BroadcastRecord.cs b/PCL.CE/Core/Link/BroadcastRecord.cs similarity index 80% rename from PCL.Core/Link/BroadcastRecord.cs rename to PCL.CE/Core/Link/BroadcastRecord.cs index bda7b3e79..d90ef3b50 100644 --- a/PCL.Core/Link/BroadcastRecord.cs +++ b/PCL.CE/Core/Link/BroadcastRecord.cs @@ -1,6 +1,6 @@ using System; using System.Net; -namespace PCL.Core.Link; +namespace PCL.CE.Core.Link; public record BroadcastRecord(string Desc, IPEndPoint Address, DateTime FoundAt); \ No newline at end of file diff --git a/PCL.Core/Link/EasyTier/ETController.cs b/PCL.CE/Core/Link/EasyTier/ETController.cs similarity index 95% rename from PCL.Core/Link/EasyTier/ETController.cs rename to PCL.CE/Core/Link/EasyTier/ETController.cs index 2067cac34..c35be3da0 100644 --- a/PCL.Core/Link/EasyTier/ETController.cs +++ b/PCL.CE/Core/Link/EasyTier/ETController.cs @@ -2,16 +2,16 @@ using System.Diagnostics; using System.IO; using System.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net; -using PCL.Core.Logging; -using PCL.Core.Utils; -using PCL.Core.Utils.Secret; -using static PCL.Core.Link.EasyTier.ETInfoProvider; -using static PCL.Core.Link.Lobby.LobbyInfoProvider; -using static PCL.Core.Link.Natayark.NatayarkProfileManager; - -namespace PCL.Core.Link.EasyTier; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Secret; +using static PCL.CE.Core.Link.EasyTier.ETInfoProvider; +using static PCL.CE.Core.Link.Lobby.LobbyInfoProvider; +using static PCL.CE.Core.Link.Natayark.NatayarkProfileManager; + +namespace PCL.CE.Core.Link.EasyTier; // ReSharper disable InconsistentNaming public enum ETState diff --git a/PCL.Core/Link/EasyTier/ETInfoProvider.cs b/PCL.CE/Core/Link/EasyTier/ETInfoProvider.cs similarity index 98% rename from PCL.Core/Link/EasyTier/ETInfoProvider.cs rename to PCL.CE/Core/Link/EasyTier/ETInfoProvider.cs index a3e51dfa4..124877789 100644 --- a/PCL.Core/Link/EasyTier/ETInfoProvider.cs +++ b/PCL.CE/Core/Link/EasyTier/ETInfoProvider.cs @@ -7,11 +7,11 @@ using System.IO; using System.Text.Json; using System.Text.Json.Nodes; -using PCL.Core.App; -using PCL.Core.IO; -using PCL.Core.Logging; +using PCL.CE.Core.App; +using PCL.CE.Core.IO; +using PCL.CE.Core.Logging; -namespace PCL.Core.Link.EasyTier; +namespace PCL.CE.Core.Link.EasyTier; // ReSharper disable InconsistentNaming, CompareOfFloatsByEqualityOperator public enum ETConnectionType diff --git a/PCL.Core/Link/EasyTier/ETPeerInfo.cs b/PCL.CE/Core/Link/EasyTier/ETPeerInfo.cs similarity index 94% rename from PCL.Core/Link/EasyTier/ETPeerInfo.cs rename to PCL.CE/Core/Link/EasyTier/ETPeerInfo.cs index 56dd8a259..66d082880 100644 --- a/PCL.Core/Link/EasyTier/ETPeerInfo.cs +++ b/PCL.CE/Core/Link/EasyTier/ETPeerInfo.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.EasyTier; +namespace PCL.CE.Core.Link.EasyTier; // ReSharper disable InconsistentNaming public record ETPeerInfo diff --git a/PCL.Core/Link/EasyTier/ETRelay.cs b/PCL.CE/Core/Link/EasyTier/ETRelay.cs similarity index 90% rename from PCL.Core/Link/EasyTier/ETRelay.cs rename to PCL.CE/Core/Link/EasyTier/ETRelay.cs index e9ae7a9e8..67ec7eba0 100644 --- a/PCL.Core/Link/EasyTier/ETRelay.cs +++ b/PCL.CE/Core/Link/EasyTier/ETRelay.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.Link.EasyTier; +namespace PCL.CE.Core.Link.EasyTier; // ReSharper disable InconsistentNaming public class ETRelay diff --git a/PCL.Core/Link/LinkAnnounce.cs b/PCL.CE/Core/Link/LinkAnnounce.cs similarity index 94% rename from PCL.Core/Link/LinkAnnounce.cs rename to PCL.CE/Core/Link/LinkAnnounce.cs index c20cf70eb..6d3d19a51 100644 --- a/PCL.Core/Link/LinkAnnounce.cs +++ b/PCL.CE/Core/Link/LinkAnnounce.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link; +namespace PCL.CE.Core.Link; public enum LinkAnnounceType { diff --git a/PCL.Core/Link/Lobby/LobbyController.cs b/PCL.CE/Core/Link/Lobby/LobbyController.cs similarity index 93% rename from PCL.Core/Link/Lobby/LobbyController.cs rename to PCL.CE/Core/Link/Lobby/LobbyController.cs index 1f8b923f8..7e738e15f 100644 --- a/PCL.Core/Link/Lobby/LobbyController.cs +++ b/PCL.CE/Core/Link/Lobby/LobbyController.cs @@ -1,12 +1,12 @@ -using PCL.Core.App; -using PCL.Core.Link.EasyTier; -using PCL.Core.Link.Scaffolding; -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.Client.Requests; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.OS; -using PCL.Core.Utils.Secret; +using PCL.CE.Core.App; +using PCL.CE.Core.Link.EasyTier; +using PCL.CE.Core.Link.Scaffolding; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Requests; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Core.Utils.Secret; using System; using System.Linq; using System.Net; @@ -14,14 +14,14 @@ using System.Text; using System.Text.Json.Nodes; using System.Threading.Tasks; -using PCL.Core.IO.Net; -using static PCL.Core.Link.Lobby.LobbyInfoProvider; -using static PCL.Core.Link.Natayark.NatayarkProfileManager; -using LobbyType = PCL.Core.Link.Scaffolding.Client.Models.LobbyType; -using PCL.Core.Link.McPing; -using PCL.Core.IO.Net.Http.Client.Request; - -namespace PCL.Core.Link.Lobby; +using PCL.CE.Core.IO.Net; +using static PCL.CE.Core.Link.Lobby.LobbyInfoProvider; +using static PCL.CE.Core.Link.Natayark.NatayarkProfileManager; +using LobbyType = PCL.CE.Core.Link.Scaffolding.Client.Models.LobbyType; +using PCL.CE.Core.Link.McPing; +using PCL.CE.Core.IO.Net.Http.Client.Request; + +namespace PCL.CE.Core.Link.Lobby; /// /// The controller of lobby that used for creating Scaffolding entity. diff --git a/PCL.Core/Link/Lobby/LobbyInfoProvider.cs b/PCL.CE/Core/Link/Lobby/LobbyInfoProvider.cs similarity index 95% rename from PCL.Core/Link/Lobby/LobbyInfoProvider.cs rename to PCL.CE/Core/Link/Lobby/LobbyInfoProvider.cs index 9d0390f19..103f4b09a 100644 --- a/PCL.Core/Link/Lobby/LobbyInfoProvider.cs +++ b/PCL.CE/Core/Link/Lobby/LobbyInfoProvider.cs @@ -1,13 +1,13 @@ using System; using System.Numerics; -using PCL.Core.App; -using PCL.Core.IO.Net; -using PCL.Core.Link.Natayark; -using PCL.Core.Logging; -using PCL.Core.Utils; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net; +using PCL.CE.Core.Link.Natayark; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Link.Lobby; +namespace PCL.CE.Core.Link.Lobby; public static class LobbyInfoProvider { diff --git a/PCL.Core/Link/Lobby/LobbyService.cs b/PCL.CE/Core/Link/Lobby/LobbyService.cs similarity index 98% rename from PCL.Core/Link/Lobby/LobbyService.cs rename to PCL.CE/Core/Link/Lobby/LobbyService.cs index 067500de1..8322d0689 100644 --- a/PCL.Core/Link/Lobby/LobbyService.cs +++ b/PCL.CE/Core/Link/Lobby/LobbyService.cs @@ -1,10 +1,10 @@ -using PCL.Core.App; -using PCL.Core.Link.Natayark; -using PCL.Core.Link.Scaffolding; -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.EasyTier; -using PCL.Core.Logging; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.Link.Natayark; +using PCL.CE.Core.Link.Scaffolding; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.EasyTier; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -14,11 +14,11 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; -using PCL.Core.App.IoC; -using PCL.Core.UI; -using PCL.Core.Link.McPing; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.UI; +using PCL.CE.Core.Link.McPing; -namespace PCL.Core.Link.Lobby; +namespace PCL.CE.Core.Link.Lobby; /// /// Lobby server. For auto-management diff --git a/PCL.Core/Link/Lobby/LobbyState.cs b/PCL.CE/Core/Link/Lobby/LobbyState.cs similarity index 96% rename from PCL.Core/Link/Lobby/LobbyState.cs rename to PCL.CE/Core/Link/Lobby/LobbyState.cs index 63311664b..851edd4c3 100644 --- a/PCL.Core/Link/Lobby/LobbyState.cs +++ b/PCL.CE/Core/Link/Lobby/LobbyState.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Link.Lobby; +namespace PCL.CE.Core.Link.Lobby; /// /// Lobby server state. diff --git a/PCL.Core/Link/Lobby/LobbyTextHandler.cs b/PCL.CE/Core/Link/Lobby/LobbyTextHandler.cs similarity index 95% rename from PCL.Core/Link/Lobby/LobbyTextHandler.cs rename to PCL.CE/Core/Link/Lobby/LobbyTextHandler.cs index 9385d6b09..e89a8a31a 100644 --- a/PCL.Core/Link/Lobby/LobbyTextHandler.cs +++ b/PCL.CE/Core/Link/Lobby/LobbyTextHandler.cs @@ -1,6 +1,6 @@ -using PCL.Core.Link.EasyTier; +using PCL.CE.Core.Link.EasyTier; -namespace PCL.Core.Link.Lobby; +namespace PCL.CE.Core.Link.Lobby; public static class LobbyTextHandler { diff --git a/PCL.Core/Link/McPing/IMcPingService.cs b/PCL.CE/Core/Link/McPing/IMcPingService.cs similarity index 91% rename from PCL.Core/Link/McPing/IMcPingService.cs rename to PCL.CE/Core/Link/McPing/IMcPingService.cs index 0a9655b96..06decd044 100644 --- a/PCL.Core/Link/McPing/IMcPingService.cs +++ b/PCL.CE/Core/Link/McPing/IMcPingService.cs @@ -1,10 +1,10 @@ -using PCL.Core.Link.McPing.Model; +using PCL.CE.Core.Link.McPing.Model; using System; using System.Net; using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.McPing; +namespace PCL.CE.Core.Link.McPing; /// /// Minecraft服务器探测服务接口 diff --git a/PCL.Core/Link/McPing/LegacyMcPingService.cs b/PCL.CE/Core/Link/McPing/LegacyMcPingService.cs similarity index 97% rename from PCL.Core/Link/McPing/LegacyMcPingService.cs rename to PCL.CE/Core/Link/McPing/LegacyMcPingService.cs index de3e3e5f5..038841861 100644 --- a/PCL.Core/Link/McPing/LegacyMcPingService.cs +++ b/PCL.CE/Core/Link/McPing/LegacyMcPingService.cs @@ -1,5 +1,5 @@ -using PCL.Core.Link.McPing.Model; -using PCL.Core.Logging; +using PCL.CE.Core.Link.McPing.Model; +using PCL.CE.Core.Logging; using System; using System.IO; using System.Linq; @@ -9,7 +9,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.McPing; +namespace PCL.CE.Core.Link.McPing; /// /// 旧版Minecraft协议服务器探测服务实现 diff --git a/PCL.Core/Link/McPing/McPingService.cs b/PCL.CE/Core/Link/McPing/McPingService.cs similarity index 98% rename from PCL.Core/Link/McPing/McPingService.cs rename to PCL.CE/Core/Link/McPing/McPingService.cs index c1cd4a25e..3df3b9709 100644 --- a/PCL.Core/Link/McPing/McPingService.cs +++ b/PCL.CE/Core/Link/McPing/McPingService.cs @@ -1,6 +1,6 @@ -using PCL.Core.Link.McPing.Model; -using PCL.Core.Logging; -using PCL.Core.Utils; +using PCL.CE.Core.Link.McPing.Model; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; using System; using System.Collections.Generic; using System.Diagnostics; @@ -14,7 +14,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.McPing; +namespace PCL.CE.Core.Link.McPing; /// /// 现代Minecraft协议服务器探测服务实现 diff --git a/PCL.Core/Link/McPing/McPingServiceFactory.cs b/PCL.CE/Core/Link/McPing/McPingServiceFactory.cs similarity index 98% rename from PCL.Core/Link/McPing/McPingServiceFactory.cs rename to PCL.CE/Core/Link/McPing/McPingServiceFactory.cs index bfdf4ff6f..75d0f4bd5 100644 --- a/PCL.Core/Link/McPing/McPingServiceFactory.cs +++ b/PCL.CE/Core/Link/McPing/McPingServiceFactory.cs @@ -1,6 +1,6 @@ using System.Net; -namespace PCL.Core.Link.McPing; +namespace PCL.CE.Core.Link.McPing; /// /// Minecraft服务器探测服务工厂 diff --git a/PCL.Core/Link/McPing/Model/McPingModInfoModResult.cs b/PCL.CE/Core/Link/McPing/Model/McPingModInfoModResult.cs similarity index 82% rename from PCL.Core/Link/McPing/Model/McPingModInfoModResult.cs rename to PCL.CE/Core/Link/McPing/Model/McPingModInfoModResult.cs index b15db4b4c..d8ade10ab 100644 --- a/PCL.Core/Link/McPing/Model/McPingModInfoModResult.cs +++ b/PCL.CE/Core/Link/McPing/Model/McPingModInfoModResult.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.McPing.Model; +namespace PCL.CE.Core.Link.McPing.Model; public record McPingModInfoModResult( [property: JsonPropertyName("modid")] string Id, diff --git a/PCL.Core/Link/McPing/Model/McPingModInfoResult.cs b/PCL.CE/Core/Link/McPing/Model/McPingModInfoResult.cs similarity index 85% rename from PCL.Core/Link/McPing/Model/McPingModInfoResult.cs rename to PCL.CE/Core/Link/McPing/Model/McPingModInfoResult.cs index aafb73e9e..dd3047063 100644 --- a/PCL.Core/Link/McPing/Model/McPingModInfoResult.cs +++ b/PCL.CE/Core/Link/McPing/Model/McPingModInfoResult.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace PCL.Core.Link.McPing.Model; +namespace PCL.CE.Core.Link.McPing.Model; public record McPingModInfoResult( [property: JsonPropertyName("type")] string Type, diff --git a/PCL.Core/Link/McPing/Model/McPingPlayerResult.cs b/PCL.CE/Core/Link/McPing/Model/McPingPlayerResult.cs similarity index 87% rename from PCL.Core/Link/McPing/Model/McPingPlayerResult.cs rename to PCL.CE/Core/Link/McPing/Model/McPingPlayerResult.cs index 7673b6573..48d454bb1 100644 --- a/PCL.Core/Link/McPing/Model/McPingPlayerResult.cs +++ b/PCL.CE/Core/Link/McPing/Model/McPingPlayerResult.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace PCL.Core.Link.McPing.Model; +namespace PCL.CE.Core.Link.McPing.Model; public record McPingPlayerResult( [property: JsonPropertyName("max")] int Max, diff --git a/PCL.Core/Link/McPing/Model/McPingPlayerSampleResult.cs b/PCL.CE/Core/Link/McPing/Model/McPingPlayerSampleResult.cs similarity index 81% rename from PCL.Core/Link/McPing/Model/McPingPlayerSampleResult.cs rename to PCL.CE/Core/Link/McPing/Model/McPingPlayerSampleResult.cs index 2ed6f9c13..b7b521ef9 100644 --- a/PCL.Core/Link/McPing/Model/McPingPlayerSampleResult.cs +++ b/PCL.CE/Core/Link/McPing/Model/McPingPlayerSampleResult.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.McPing.Model; +namespace PCL.CE.Core.Link.McPing.Model; public record McPingPlayerSampleResult( [property: JsonPropertyName("name")] string Name, diff --git a/PCL.Core/Link/McPing/Model/McPingResult.cs b/PCL.CE/Core/Link/McPing/Model/McPingResult.cs similarity index 93% rename from PCL.Core/Link/McPing/Model/McPingResult.cs rename to PCL.CE/Core/Link/McPing/Model/McPingResult.cs index 7ad10d665..b33eba03c 100644 --- a/PCL.Core/Link/McPing/Model/McPingResult.cs +++ b/PCL.CE/Core/Link/McPing/Model/McPingResult.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.McPing.Model; +namespace PCL.CE.Core.Link.McPing.Model; public record McPingResult( [property: JsonPropertyName("version")] McPingVersionResult Version, diff --git a/PCL.Core/Link/McPing/Model/McPingVersionResult.cs b/PCL.CE/Core/Link/McPing/Model/McPingVersionResult.cs similarity index 82% rename from PCL.Core/Link/McPing/Model/McPingVersionResult.cs rename to PCL.CE/Core/Link/McPing/Model/McPingVersionResult.cs index f7412dfee..16225b009 100644 --- a/PCL.Core/Link/McPing/Model/McPingVersionResult.cs +++ b/PCL.CE/Core/Link/McPing/Model/McPingVersionResult.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.McPing.Model; +namespace PCL.CE.Core.Link.McPing.Model; public record McPingVersionResult( [property: JsonPropertyName("name")] string Name, diff --git a/PCL.Core/Link/Natayark/NatayarkProfileManager.cs b/PCL.CE/Core/Link/Natayark/NatayarkProfileManager.cs similarity index 97% rename from PCL.Core/Link/Natayark/NatayarkProfileManager.cs rename to PCL.CE/Core/Link/Natayark/NatayarkProfileManager.cs index 7191532bb..040ef8a6f 100644 --- a/PCL.Core/Link/Natayark/NatayarkProfileManager.cs +++ b/PCL.CE/Core/Link/Natayark/NatayarkProfileManager.cs @@ -1,15 +1,15 @@ -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.OS; using System; using System.Net.Http; using System.Text; using System.Text.Json.Nodes; using System.Threading.Tasks; -using PCL.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.IO.Net.Http.Client.Request; -namespace PCL.Core.Link.Natayark; +namespace PCL.CE.Core.Link.Natayark; public class NaidUser { diff --git a/PCL.Core/Link/Scaffolding/Client/Abstractions/IRequest.cs b/PCL.CE/Core/Link/Scaffolding/Client/Abstractions/IRequest.cs similarity index 92% rename from PCL.Core/Link/Scaffolding/Client/Abstractions/IRequest.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Abstractions/IRequest.cs index 84eeb56a2..b8382779f 100644 --- a/PCL.Core/Link/Scaffolding/Client/Abstractions/IRequest.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Abstractions/IRequest.cs @@ -1,7 +1,7 @@ using System; using System.Buffers; -namespace PCL.Core.Link.Scaffolding.Client.Abstractions; +namespace PCL.CE.Core.Link.Scaffolding.Client.Abstractions; public interface IRequest { diff --git a/PCL.Core/Link/Scaffolding/Client/Abstractions/ScaffoldingResponse.cs b/PCL.CE/Core/Link/Scaffolding/Client/Abstractions/ScaffoldingResponse.cs similarity index 60% rename from PCL.Core/Link/Scaffolding/Client/Abstractions/ScaffoldingResponse.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Abstractions/ScaffoldingResponse.cs index 76fc085f9..c370d5338 100644 --- a/PCL.Core/Link/Scaffolding/Client/Abstractions/ScaffoldingResponse.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Abstractions/ScaffoldingResponse.cs @@ -1,5 +1,5 @@ using System; -namespace PCL.Core.Link.Scaffolding.Client.Abstractions; +namespace PCL.CE.Core.Link.Scaffolding.Client.Abstractions; public record ScaffoldingResponse(byte Status, ReadOnlyMemory Body); \ No newline at end of file diff --git a/PCL.Core/Link/Scaffolding/Client/Framing/ProtocolReader.cs b/PCL.CE/Core/Link/Scaffolding/Client/Framing/ProtocolReader.cs similarity index 94% rename from PCL.Core/Link/Scaffolding/Client/Framing/ProtocolReader.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Framing/ProtocolReader.cs index 0d31389dc..d8a1a6f86 100644 --- a/PCL.Core/Link/Scaffolding/Client/Framing/ProtocolReader.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Framing/ProtocolReader.cs @@ -5,10 +5,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Link.Scaffolding.Client.Abstractions; -using PCL.Core.Link.Scaffolding.Exceptions; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Exceptions; -namespace PCL.Core.Link.Scaffolding.Client.Framing; +namespace PCL.CE.Core.Link.Scaffolding.Client.Framing; internal static class ProtocolReader { diff --git a/PCL.Core/Link/Scaffolding/Client/Framing/ProtocolWriter.cs b/PCL.CE/Core/Link/Scaffolding/Client/Framing/ProtocolWriter.cs similarity index 93% rename from PCL.Core/Link/Scaffolding/Client/Framing/ProtocolWriter.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Framing/ProtocolWriter.cs index 55f3dccb2..f89c31e60 100644 --- a/PCL.Core/Link/Scaffolding/Client/Framing/ProtocolWriter.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Framing/ProtocolWriter.cs @@ -5,9 +5,9 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; -namespace PCL.Core.Link.Scaffolding.Client.Framing; +namespace PCL.CE.Core.Link.Scaffolding.Client.Framing; internal static class ProtocolWriter { diff --git a/PCL.Core/Link/Scaffolding/Client/Models/LobbyInfo.cs b/PCL.CE/Core/Link/Scaffolding/Client/Models/LobbyInfo.cs similarity index 60% rename from PCL.Core/Link/Scaffolding/Client/Models/LobbyInfo.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Models/LobbyInfo.cs index d672e50e6..ee9772e3a 100644 --- a/PCL.Core/Link/Scaffolding/Client/Models/LobbyInfo.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Models/LobbyInfo.cs @@ -1,3 +1,3 @@ -namespace PCL.Core.Link.Scaffolding.Client.Models; +namespace PCL.CE.Core.Link.Scaffolding.Client.Models; public record LobbyInfo(string FullCode, string NetworkName, string NetworkSecret); \ No newline at end of file diff --git a/PCL.Core/Link/Scaffolding/Client/Models/LobbyType.cs b/PCL.CE/Core/Link/Scaffolding/Client/Models/LobbyType.cs similarity index 68% rename from PCL.Core/Link/Scaffolding/Client/Models/LobbyType.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Models/LobbyType.cs index 21cd38f9c..68374a00d 100644 --- a/PCL.Core/Link/Scaffolding/Client/Models/LobbyType.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Models/LobbyType.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Link.Scaffolding.Client.Models; +namespace PCL.CE.Core.Link.Scaffolding.Client.Models; public enum LobbyType { diff --git a/PCL.Core/Link/Scaffolding/Client/Models/PlayerKind.cs b/PCL.CE/Core/Link/Scaffolding/Client/Models/PlayerKind.cs similarity index 76% rename from PCL.Core/Link/Scaffolding/Client/Models/PlayerKind.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Models/PlayerKind.cs index 0c3e20929..58db0ff13 100644 --- a/PCL.Core/Link/Scaffolding/Client/Models/PlayerKind.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Models/PlayerKind.cs @@ -2,7 +2,7 @@ // ReSharper disable InconsistentNaming -namespace PCL.Core.Link.Scaffolding.Client.Models; +namespace PCL.CE.Core.Link.Scaffolding.Client.Models; [JsonConverter(typeof(JsonStringEnumConverter))] public enum PlayerKind diff --git a/PCL.Core/Link/Scaffolding/Client/Models/PlayerProfile.cs b/PCL.CE/Core/Link/Scaffolding/Client/Models/PlayerProfile.cs similarity index 89% rename from PCL.Core/Link/Scaffolding/Client/Models/PlayerProfile.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Models/PlayerProfile.cs index 9c3c9886e..470fd4df4 100644 --- a/PCL.Core/Link/Scaffolding/Client/Models/PlayerProfile.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Models/PlayerProfile.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.Scaffolding.Client.Models; +namespace PCL.CE.Core.Link.Scaffolding.Client.Models; public record PlayerProfile { diff --git a/PCL.Core/Link/Scaffolding/Client/Requests/GetPlayerProfileListRequest.cs b/PCL.CE/Core/Link/Scaffolding/Client/Requests/GetPlayerProfileListRequest.cs similarity index 85% rename from PCL.Core/Link/Scaffolding/Client/Requests/GetPlayerProfileListRequest.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Requests/GetPlayerProfileListRequest.cs index f54de040b..2d3acb7c2 100644 --- a/PCL.Core/Link/Scaffolding/Client/Requests/GetPlayerProfileListRequest.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Requests/GetPlayerProfileListRequest.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; -using PCL.Core.Link.Scaffolding.Client.Abstractions; -using PCL.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Models; -namespace PCL.Core.Link.Scaffolding.Client.Requests; +namespace PCL.CE.Core.Link.Scaffolding.Client.Requests; public sealed class GetPlayerProfileListRequest : IRequest> { diff --git a/PCL.Core/Link/Scaffolding/Client/Requests/GetProtocolsRequest.cs b/PCL.CE/Core/Link/Scaffolding/Client/Requests/GetProtocolsRequest.cs similarity index 90% rename from PCL.Core/Link/Scaffolding/Client/Requests/GetProtocolsRequest.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Requests/GetProtocolsRequest.cs index b476cbdd6..778f58e78 100644 --- a/PCL.Core/Link/Scaffolding/Client/Requests/GetProtocolsRequest.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Requests/GetProtocolsRequest.cs @@ -2,9 +2,9 @@ using System.Buffers; using System.Collections.Generic; using System.Text; -using PCL.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; -namespace PCL.Core.Link.Scaffolding.Client.Requests; +namespace PCL.CE.Core.Link.Scaffolding.Client.Requests; public sealed class GetProtocolsRequest(IEnumerable supportProtocols) : IRequest> { diff --git a/PCL.Core/Link/Scaffolding/Client/Requests/GetServerProtRequest.cs b/PCL.CE/Core/Link/Scaffolding/Client/Requests/GetServerProtRequest.cs similarity index 85% rename from PCL.Core/Link/Scaffolding/Client/Requests/GetServerProtRequest.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Requests/GetServerProtRequest.cs index 197dc49af..0ec2282ec 100644 --- a/PCL.Core/Link/Scaffolding/Client/Requests/GetServerProtRequest.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Requests/GetServerProtRequest.cs @@ -1,9 +1,9 @@ using System; using System.Buffers; using System.Buffers.Binary; -using PCL.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; -namespace PCL.Core.Link.Scaffolding.Client.Requests; +namespace PCL.CE.Core.Link.Scaffolding.Client.Requests; public sealed class GetServerPortRequest : IRequest { diff --git a/PCL.Core/Link/Scaffolding/Client/Requests/PingRequest.cs b/PCL.CE/Core/Link/Scaffolding/Client/Requests/PingRequest.cs similarity index 87% rename from PCL.Core/Link/Scaffolding/Client/Requests/PingRequest.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Requests/PingRequest.cs index 77ed0aa8d..100fb19d8 100644 --- a/PCL.Core/Link/Scaffolding/Client/Requests/PingRequest.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Requests/PingRequest.cs @@ -1,8 +1,8 @@ using System; using System.Buffers; -using PCL.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; -namespace PCL.Core.Link.Scaffolding.Client.Requests; +namespace PCL.CE.Core.Link.Scaffolding.Client.Requests; public sealed class PingRequest : IRequest> { diff --git a/PCL.Core/Link/Scaffolding/Client/Requests/PlayerPingRequest.cs b/PCL.CE/Core/Link/Scaffolding/Client/Requests/PlayerPingRequest.cs similarity index 86% rename from PCL.Core/Link/Scaffolding/Client/Requests/PlayerPingRequest.cs rename to PCL.CE/Core/Link/Scaffolding/Client/Requests/PlayerPingRequest.cs index 0fc80a448..c9dee3921 100644 --- a/PCL.Core/Link/Scaffolding/Client/Requests/PlayerPingRequest.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/Requests/PlayerPingRequest.cs @@ -2,10 +2,10 @@ using System.Buffers; using System.Text.Json; using System.Text.Json.Serialization; -using PCL.Core.Link.Scaffolding.Client.Abstractions; -using PCL.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Models; -namespace PCL.Core.Link.Scaffolding.Client.Requests; +namespace PCL.CE.Core.Link.Scaffolding.Client.Requests; public sealed class PlayerPingRequest(string name, string machineId, string vendor) : IRequest { diff --git a/PCL.Core/Link/Scaffolding/Client/ScaffoldingClient.cs b/PCL.CE/Core/Link/Scaffolding/Client/ScaffoldingClient.cs similarity index 96% rename from PCL.Core/Link/Scaffolding/Client/ScaffoldingClient.cs rename to PCL.CE/Core/Link/Scaffolding/Client/ScaffoldingClient.cs index 448012d1b..b52d6584b 100644 --- a/PCL.Core/Link/Scaffolding/Client/ScaffoldingClient.cs +++ b/PCL.CE/Core/Link/Scaffolding/Client/ScaffoldingClient.cs @@ -1,8 +1,8 @@ -using PCL.Core.Link.Scaffolding.Client.Abstractions; -using PCL.Core.Link.Scaffolding.Client.Framing; -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.Client.Requests; -using PCL.Core.Logging; +using PCL.CE.Core.Link.Scaffolding.Client.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Client.Framing; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Requests; +using PCL.CE.Core.Logging; using System; using System.Collections.Generic; using System.Diagnostics; @@ -11,7 +11,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.Scaffolding.Client; +namespace PCL.CE.Core.Link.Scaffolding.Client; internal enum ClientState { diff --git a/PCL.Core/Link/Scaffolding/EasyTier/CliNetTest.cs b/PCL.CE/Core/Link/Scaffolding/EasyTier/CliNetTest.cs similarity index 97% rename from PCL.Core/Link/Scaffolding/EasyTier/CliNetTest.cs rename to PCL.CE/Core/Link/Scaffolding/EasyTier/CliNetTest.cs index d8763393c..ac5825a47 100644 --- a/PCL.Core/Link/Scaffolding/EasyTier/CliNetTest.cs +++ b/PCL.CE/Core/Link/Scaffolding/EasyTier/CliNetTest.cs @@ -4,9 +4,9 @@ using System.Text; using System.Text.Json; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.Link.Scaffolding.EasyTier; +namespace PCL.CE.Core.Link.Scaffolding.EasyTier; public class CliNetTest { diff --git a/PCL.Core/Link/Scaffolding/EasyTier/EasyPlayerInfo.cs b/PCL.CE/Core/Link/Scaffolding/EasyTier/EasyPlayerInfo.cs similarity index 92% rename from PCL.Core/Link/Scaffolding/EasyTier/EasyPlayerInfo.cs rename to PCL.CE/Core/Link/Scaffolding/EasyTier/EasyPlayerInfo.cs index ccb0f165f..fee9f7a27 100644 --- a/PCL.Core/Link/Scaffolding/EasyTier/EasyPlayerInfo.cs +++ b/PCL.CE/Core/Link/Scaffolding/EasyTier/EasyPlayerInfo.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Link.Scaffolding.EasyTier; +namespace PCL.CE.Core.Link.Scaffolding.EasyTier; public enum ConnectionWay { diff --git a/PCL.Core/Link/Scaffolding/EasyTier/EasyTierEntity.cs b/PCL.CE/Core/Link/Scaffolding/EasyTier/EasyTierEntity.cs similarity index 98% rename from PCL.Core/Link/Scaffolding/EasyTier/EasyTierEntity.cs rename to PCL.CE/Core/Link/Scaffolding/EasyTier/EasyTierEntity.cs index 965faff21..ace3d8e23 100644 --- a/PCL.Core/Link/Scaffolding/EasyTier/EasyTierEntity.cs +++ b/PCL.CE/Core/Link/Scaffolding/EasyTier/EasyTierEntity.cs @@ -1,8 +1,8 @@ -using PCL.Core.App; -using PCL.Core.Link.EasyTier; -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Logging; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.Link.EasyTier; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; using Polly; using System; using System.Collections.Generic; @@ -16,10 +16,10 @@ using System.Text.Json.Nodes; using System.Threading; using System.Threading.Tasks; -using PCL.Core.IO.Net; -using PCL.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.IO.Net; +using PCL.CE.Core.IO.Net.Http.Client.Request; -namespace PCL.Core.Link.Scaffolding.EasyTier; +namespace PCL.CE.Core.Link.Scaffolding.EasyTier; /// /// Demonstrates the state of EasyTier entity. diff --git a/PCL.Core/Link/Scaffolding/EasyTier/EasyTierMetadata.cs b/PCL.CE/Core/Link/Scaffolding/EasyTier/EasyTierMetadata.cs similarity index 80% rename from PCL.Core/Link/Scaffolding/EasyTier/EasyTierMetadata.cs rename to PCL.CE/Core/Link/Scaffolding/EasyTier/EasyTierMetadata.cs index ef58f5dcc..c8a09c1eb 100644 --- a/PCL.Core/Link/Scaffolding/EasyTier/EasyTierMetadata.cs +++ b/PCL.CE/Core/Link/Scaffolding/EasyTier/EasyTierMetadata.cs @@ -1,9 +1,9 @@ using System.IO; using System.Runtime.InteropServices; -using PCL.Core.App; -using PCL.Core.IO; +using PCL.CE.Core.App; +using PCL.CE.Core.IO; -namespace PCL.Core.Link.Scaffolding.EasyTier; +namespace PCL.CE.Core.Link.Scaffolding.EasyTier; public static class EasyTierMetadata { diff --git a/PCL.Core/Link/Scaffolding/EasyTier/PublicNodeDto.cs b/PCL.CE/Core/Link/Scaffolding/EasyTier/PublicNodeDto.cs similarity index 92% rename from PCL.Core/Link/Scaffolding/EasyTier/PublicNodeDto.cs rename to PCL.CE/Core/Link/Scaffolding/EasyTier/PublicNodeDto.cs index 195edee01..3c7f95426 100644 --- a/PCL.Core/Link/Scaffolding/EasyTier/PublicNodeDto.cs +++ b/PCL.CE/Core/Link/Scaffolding/EasyTier/PublicNodeDto.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace PCL.Core.Link.Scaffolding.EasyTier; +namespace PCL.CE.Core.Link.Scaffolding.EasyTier; internal record PublicNodeDto { diff --git a/PCL.Core/Link/Scaffolding/EasyTier/StunInfo.cs b/PCL.CE/Core/Link/Scaffolding/EasyTier/StunInfo.cs similarity index 86% rename from PCL.Core/Link/Scaffolding/EasyTier/StunInfo.cs rename to PCL.CE/Core/Link/Scaffolding/EasyTier/StunInfo.cs index 1b3c24245..92adfcf7a 100644 --- a/PCL.Core/Link/Scaffolding/EasyTier/StunInfo.cs +++ b/PCL.CE/Core/Link/Scaffolding/EasyTier/StunInfo.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Link.Scaffolding.EasyTier; +namespace PCL.CE.Core.Link.Scaffolding.EasyTier; public record StunInfo { diff --git a/PCL.Core/Link/Scaffolding/Exceptions/FailedToGetPlayerException.cs b/PCL.CE/Core/Link/Scaffolding/Exceptions/FailedToGetPlayerException.cs similarity index 80% rename from PCL.Core/Link/Scaffolding/Exceptions/FailedToGetPlayerException.cs rename to PCL.CE/Core/Link/Scaffolding/Exceptions/FailedToGetPlayerException.cs index a968b993e..cbd98aee0 100644 --- a/PCL.Core/Link/Scaffolding/Exceptions/FailedToGetPlayerException.cs +++ b/PCL.CE/Core/Link/Scaffolding/Exceptions/FailedToGetPlayerException.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Link.Scaffolding.Exceptions; +namespace PCL.CE.Core.Link.Scaffolding.Exceptions; public class FailedToGetPlayerException : Exception { diff --git a/PCL.Core/Link/Scaffolding/Exceptions/ScaffoldingRequestException.cs b/PCL.CE/Core/Link/Scaffolding/Exceptions/ScaffoldingRequestException.cs similarity index 95% rename from PCL.Core/Link/Scaffolding/Exceptions/ScaffoldingRequestException.cs rename to PCL.CE/Core/Link/Scaffolding/Exceptions/ScaffoldingRequestException.cs index 683db5b48..9387699f0 100644 --- a/PCL.Core/Link/Scaffolding/Exceptions/ScaffoldingRequestException.cs +++ b/PCL.CE/Core/Link/Scaffolding/Exceptions/ScaffoldingRequestException.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Link.Scaffolding.Exceptions; +namespace PCL.CE.Core.Link.Scaffolding.Exceptions; /// /// Exception thrown when a scaffolding request fails with a non-success status code. diff --git a/PCL.Core/Link/Scaffolding/LobbyCodeGenerator.cs b/PCL.CE/Core/Link/Scaffolding/LobbyCodeGenerator.cs similarity index 98% rename from PCL.Core/Link/Scaffolding/LobbyCodeGenerator.cs rename to PCL.CE/Core/Link/Scaffolding/LobbyCodeGenerator.cs index 4a2c3862c..81fdcc324 100644 --- a/PCL.Core/Link/Scaffolding/LobbyCodeGenerator.cs +++ b/PCL.CE/Core/Link/Scaffolding/LobbyCodeGenerator.cs @@ -1,14 +1,14 @@ // This code is from terracota project. // Thanks for Burning_TNT's contribution! -using PCL.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Models; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Security.Cryptography; -namespace PCL.Core.Link.Scaffolding; +namespace PCL.CE.Core.Link.Scaffolding; public static class LobbyCodeGenerator { diff --git a/PCL.Core/Link/Scaffolding/PlayerListHandler.cs b/PCL.CE/Core/Link/Scaffolding/PlayerListHandler.cs similarity index 84% rename from PCL.Core/Link/Scaffolding/PlayerListHandler.cs rename to PCL.CE/Core/Link/Scaffolding/PlayerListHandler.cs index 9370b77bd..e1938e1ae 100644 --- a/PCL.Core/Link/Scaffolding/PlayerListHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/PlayerListHandler.cs @@ -1,7 +1,7 @@ -using PCL.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Models; using System.Collections.Generic; -namespace PCL.Core.Link.Scaffolding; +namespace PCL.CE.Core.Link.Scaffolding; public class PlayerListHandler { diff --git a/PCL.Core/Link/Scaffolding/ScaffoldingFactory.cs b/PCL.CE/Core/Link/Scaffolding/ScaffoldingFactory.cs similarity index 91% rename from PCL.Core/Link/Scaffolding/ScaffoldingFactory.cs rename to PCL.CE/Core/Link/Scaffolding/ScaffoldingFactory.cs index dc033ebee..5fa17a633 100644 --- a/PCL.Core/Link/Scaffolding/ScaffoldingFactory.cs +++ b/PCL.CE/Core/Link/Scaffolding/ScaffoldingFactory.cs @@ -1,14 +1,14 @@ -using PCL.Core.Link.Scaffolding.Client; -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.EasyTier; -using PCL.Core.Link.Scaffolding.Exceptions; -using PCL.Core.Link.Scaffolding.Server; -using PCL.Core.App; +using PCL.CE.Core.Link.Scaffolding.Client; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.EasyTier; +using PCL.CE.Core.Link.Scaffolding.Exceptions; +using PCL.CE.Core.Link.Scaffolding.Server; +using PCL.CE.Core.App; using System; using System.Threading.Tasks; -using PCL.Core.IO.Net; +using PCL.CE.Core.IO.Net; -namespace PCL.Core.Link.Scaffolding; +namespace PCL.CE.Core.Link.Scaffolding; public static class ScaffoldingFactory { diff --git a/PCL.Core/Link/Scaffolding/Server/Abstractions/IRequestHandler.cs b/PCL.CE/Core/Link/Scaffolding/Server/Abstractions/IRequestHandler.cs similarity index 93% rename from PCL.Core/Link/Scaffolding/Server/Abstractions/IRequestHandler.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Abstractions/IRequestHandler.cs index 4d0497053..bc176c674 100644 --- a/PCL.Core/Link/Scaffolding/Server/Abstractions/IRequestHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Abstractions/IRequestHandler.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.Scaffolding.Server.Abstractions; +namespace PCL.CE.Core.Link.Scaffolding.Server.Abstractions; public interface IRequestHandler { diff --git a/PCL.Core/Link/Scaffolding/Server/Abstractions/IServerContext.cs b/PCL.CE/Core/Link/Scaffolding/Server/Abstractions/IServerContext.cs similarity index 90% rename from PCL.Core/Link/Scaffolding/Server/Abstractions/IServerContext.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Abstractions/IServerContext.cs index db6c5072d..0c72c697b 100644 --- a/PCL.Core/Link/Scaffolding/Server/Abstractions/IServerContext.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Abstractions/IServerContext.cs @@ -1,9 +1,9 @@ -using PCL.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Models; using System; using System.Collections.Concurrent; using System.Collections.Generic; -namespace PCL.Core.Link.Scaffolding.Server.Abstractions; +namespace PCL.CE.Core.Link.Scaffolding.Server.Abstractions; public interface IServerContext { diff --git a/PCL.Core/Link/Scaffolding/Server/Handlers/GetPlayerProfileListHandler.cs b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetPlayerProfileListHandler.cs similarity index 84% rename from PCL.Core/Link/Scaffolding/Server/Handlers/GetPlayerProfileListHandler.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetPlayerProfileListHandler.cs index 896c45fdb..f08c7d48e 100644 --- a/PCL.Core/Link/Scaffolding/Server/Handlers/GetPlayerProfileListHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetPlayerProfileListHandler.cs @@ -1,14 +1,14 @@ -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.Server.Abstractions; -using PCL.Core.Link.Scaffolding.EasyTier; -using PCL.Core.App; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.Link.Scaffolding.EasyTier; +using PCL.CE.Core.App; using System; using System.Text.Json; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.Scaffolding.Server.Handlers; +namespace PCL.CE.Core.Link.Scaffolding.Server.Handlers; public class GetPlayerProfileListHandler : IRequestHandler { diff --git a/PCL.Core/Link/Scaffolding/Server/Handlers/GetProtocolsHandler.cs b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetProtocolsHandler.cs similarity index 88% rename from PCL.Core/Link/Scaffolding/Server/Handlers/GetProtocolsHandler.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetProtocolsHandler.cs index 16bf5ce2b..feba613da 100644 --- a/PCL.Core/Link/Scaffolding/Server/Handlers/GetProtocolsHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetProtocolsHandler.cs @@ -2,9 +2,9 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; -namespace PCL.Core.Link.Scaffolding.Server.Handlers; +namespace PCL.CE.Core.Link.Scaffolding.Server.Handlers; public class GetProtocolsHandler : IRequestHandler { diff --git a/PCL.Core/Link/Scaffolding/Server/Handlers/GetServerPortHandler.cs b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetServerPortHandler.cs similarity index 88% rename from PCL.Core/Link/Scaffolding/Server/Handlers/GetServerPortHandler.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetServerPortHandler.cs index a8db83030..7f7a6480f 100644 --- a/PCL.Core/Link/Scaffolding/Server/Handlers/GetServerPortHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/GetServerPortHandler.cs @@ -1,10 +1,10 @@ -using PCL.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; using System; using System.Buffers.Binary; using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.Scaffolding.Server.Handlers; +namespace PCL.CE.Core.Link.Scaffolding.Server.Handlers; public class GetServerPortHandler : IRequestHandler { diff --git a/PCL.Core/Link/Scaffolding/Server/Handlers/PingHandler.cs b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/PingHandler.cs similarity index 80% rename from PCL.Core/Link/Scaffolding/Server/Handlers/PingHandler.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Handlers/PingHandler.cs index c3defc2fd..22bbcdbb6 100644 --- a/PCL.Core/Link/Scaffolding/Server/Handlers/PingHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/PingHandler.cs @@ -1,9 +1,9 @@ using System; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; -namespace PCL.Core.Link.Scaffolding.Server.Handlers; +namespace PCL.CE.Core.Link.Scaffolding.Server.Handlers; public class PingHandler : IRequestHandler { diff --git a/PCL.Core/Link/Scaffolding/Server/Handlers/PlayerPingHandler.cs b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/PlayerPingHandler.cs similarity index 93% rename from PCL.Core/Link/Scaffolding/Server/Handlers/PlayerPingHandler.cs rename to PCL.CE/Core/Link/Scaffolding/Server/Handlers/PlayerPingHandler.cs index aff086304..77749b527 100644 --- a/PCL.Core/Link/Scaffolding/Server/Handlers/PlayerPingHandler.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/Handlers/PlayerPingHandler.cs @@ -1,13 +1,13 @@ -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.Server.Abstractions; -using PCL.Core.Logging; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.Logging; using System; using System.Text.Json; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.Scaffolding.Server.Handlers; +namespace PCL.CE.Core.Link.Scaffolding.Server.Handlers; public class PlayerPingHandler : IRequestHandler { diff --git a/PCL.Core/Link/Scaffolding/Server/ScaffoldingServer.cs b/PCL.CE/Core/Link/Scaffolding/Server/ScaffoldingServer.cs similarity index 98% rename from PCL.Core/Link/Scaffolding/Server/ScaffoldingServer.cs rename to PCL.CE/Core/Link/Scaffolding/Server/ScaffoldingServer.cs index 9ebbc33c0..2fb11f57d 100644 --- a/PCL.Core/Link/Scaffolding/Server/ScaffoldingServer.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/ScaffoldingServer.cs @@ -1,7 +1,7 @@ -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.Server.Abstractions; -using PCL.Core.Link.Scaffolding.Server.Handlers; -using PCL.Core.Logging; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.Link.Scaffolding.Server.Handlers; +using PCL.CE.Core.Logging; using System; using System.Buffers; using System.Buffers.Binary; @@ -14,7 +14,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Link.Scaffolding.Server; +namespace PCL.CE.Core.Link.Scaffolding.Server; /// /// A server for the Scaffolding data exchange protocol. diff --git a/PCL.Core/Link/Scaffolding/Server/ScaffoldingServerContext.cs b/PCL.CE/Core/Link/Scaffolding/Server/ScaffoldingServerContext.cs similarity index 91% rename from PCL.Core/Link/Scaffolding/Server/ScaffoldingServerContext.cs rename to PCL.CE/Core/Link/Scaffolding/Server/ScaffoldingServerContext.cs index b5ab35448..dc0f34a0c 100644 --- a/PCL.Core/Link/Scaffolding/Server/ScaffoldingServerContext.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/ScaffoldingServerContext.cs @@ -1,15 +1,15 @@ -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.EasyTier; -using PCL.Core.Link.Scaffolding.Server.Abstractions; -using PCL.Core.App; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.EasyTier; +using PCL.CE.Core.Link.Scaffolding.Server.Abstractions; +using PCL.CE.Core.App; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.Link.Scaffolding.Server; +namespace PCL.CE.Core.Link.Scaffolding.Server; /// /// Scaffolding Server running context. diff --git a/PCL.Core/Link/Scaffolding/Server/TrackedPlayerProfile.cs b/PCL.CE/Core/Link/Scaffolding/Server/TrackedPlayerProfile.cs similarity index 63% rename from PCL.Core/Link/Scaffolding/Server/TrackedPlayerProfile.cs rename to PCL.CE/Core/Link/Scaffolding/Server/TrackedPlayerProfile.cs index 2ddb79d89..1a0962a1f 100644 --- a/PCL.Core/Link/Scaffolding/Server/TrackedPlayerProfile.cs +++ b/PCL.CE/Core/Link/Scaffolding/Server/TrackedPlayerProfile.cs @@ -1,7 +1,7 @@ -using PCL.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.Client.Models; using System; -namespace PCL.Core.Link.Scaffolding.Server; +namespace PCL.CE.Core.Link.Scaffolding.Server; public record TrackedPlayerProfile { diff --git a/PCL.Core/Logging/ActionLevel.cs b/PCL.CE/Core/Logging/ActionLevel.cs similarity index 86% rename from PCL.Core/Logging/ActionLevel.cs rename to PCL.CE/Core/Logging/ActionLevel.cs index 15c56323b..5eb273589 100644 --- a/PCL.Core/Logging/ActionLevel.cs +++ b/PCL.CE/Core/Logging/ActionLevel.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; /// /// 事件/意外行为等级。 diff --git a/PCL.Core/Logging/LogLevel.cs b/PCL.CE/Core/Logging/LogLevel.cs similarity index 97% rename from PCL.Core/Logging/LogLevel.cs rename to PCL.CE/Core/Logging/LogLevel.cs index 19d1a760d..dcecdec6d 100644 --- a/PCL.Core/Logging/LogLevel.cs +++ b/PCL.CE/Core/Logging/LogLevel.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; /// /// 日志等级。将十进制值 % 100 并显式转换可得到该等级默认对应的 diff --git a/PCL.Core/Logging/LogService.cs b/PCL.CE/Core/Logging/LogService.cs similarity index 96% rename from PCL.Core/Logging/LogService.cs rename to PCL.CE/Core/Logging/LogService.cs index 879993ea4..5c9866c8e 100644 --- a/PCL.Core/Logging/LogService.cs +++ b/PCL.CE/Core/Logging/LogService.cs @@ -3,12 +3,12 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; -using PCL.Core.App; -using PCL.Core.App.Essentials; -using PCL.Core.App.IoC; -using PCL.Core.UI; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Essentials; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.UI; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; [LifecycleService(LifecycleState.Loading, Priority = int.MaxValue)] public class LogService : ILifecycleLogService diff --git a/PCL.Core/Logging/LogWrapper.cs b/PCL.CE/Core/Logging/LogWrapper.cs similarity index 98% rename from PCL.Core/Logging/LogWrapper.cs rename to PCL.CE/Core/Logging/LogWrapper.cs index fdbdc0a6b..fecb36237 100644 --- a/PCL.Core/Logging/LogWrapper.cs +++ b/PCL.CE/Core/Logging/LogWrapper.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; public delegate void LogHandler(LogLevel level, string msg, string? module = null, Exception? ex = null); diff --git a/PCL.Core/Logging/Logger.cs b/PCL.CE/Core/Logging/Logger.cs similarity index 99% rename from PCL.Core/Logging/Logger.cs rename to PCL.CE/Core/Logging/Logger.cs index 1771b4f84..179616aa2 100644 --- a/PCL.Core/Logging/Logger.cs +++ b/PCL.CE/Core/Logging/Logger.cs @@ -8,9 +8,9 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; public sealed class Logger : IAsyncDisposable { diff --git a/PCL.Core/Logging/LoggerAdapter.cs b/PCL.CE/Core/Logging/LoggerAdapter.cs similarity index 99% rename from PCL.Core/Logging/LoggerAdapter.cs rename to PCL.CE/Core/Logging/LoggerAdapter.cs index 4ad9990fa..8e646b9d3 100644 --- a/PCL.Core/Logging/LoggerAdapter.cs +++ b/PCL.CE/Core/Logging/LoggerAdapter.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; /// /// Microsoft.Extensions.Logging.ILogger 适配器 diff --git a/PCL.Core/Logging/LoggerConfiguration.cs b/PCL.CE/Core/Logging/LoggerConfiguration.cs similarity index 87% rename from PCL.Core/Logging/LoggerConfiguration.cs rename to PCL.CE/Core/Logging/LoggerConfiguration.cs index ea894bf18..91f30c22b 100644 --- a/PCL.Core/Logging/LoggerConfiguration.cs +++ b/PCL.CE/Core/Logging/LoggerConfiguration.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; public record LoggerConfiguration( string StoreFolder, diff --git a/PCL.Core/Logging/LoggerExtensions.cs b/PCL.CE/Core/Logging/LoggerExtensions.cs similarity index 99% rename from PCL.Core/Logging/LoggerExtensions.cs rename to PCL.CE/Core/Logging/LoggerExtensions.cs index 33f650e07..1e9009e7d 100644 --- a/PCL.Core/Logging/LoggerExtensions.cs +++ b/PCL.CE/Core/Logging/LoggerExtensions.cs @@ -2,7 +2,7 @@ using System.Diagnostics; using Microsoft.Extensions.Logging; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; public static class LoggerExtensions { diff --git a/PCL.Core/Logging/LoggerFactoryAdapter.cs b/PCL.CE/Core/Logging/LoggerFactoryAdapter.cs similarity index 96% rename from PCL.Core/Logging/LoggerFactoryAdapter.cs rename to PCL.CE/Core/Logging/LoggerFactoryAdapter.cs index 5a610fca6..af4033859 100644 --- a/PCL.Core/Logging/LoggerFactoryAdapter.cs +++ b/PCL.CE/Core/Logging/LoggerFactoryAdapter.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; -namespace PCL.Core.Logging; +namespace PCL.CE.Core.Logging; /// /// ILoggerFactory 实现,用于创建 LoggerAdapter 实例 diff --git a/PCL.Core/Minecraft/GameCore.cs b/PCL.CE/Core/Minecraft/GameCore.cs similarity index 98% rename from PCL.Core/Minecraft/GameCore.cs rename to PCL.CE/Core/Minecraft/GameCore.cs index 019d1f334..5b1594273 100644 --- a/PCL.Core/Minecraft/GameCore.cs +++ b/PCL.CE/Core/Minecraft/GameCore.cs @@ -1,7 +1,7 @@ using System.IO; using System.IO.Compression; -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; public class GameCore { diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebKeys.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebKeys.cs similarity index 69% rename from PCL.Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebKeys.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebKeys.cs index e04862ee9..2798bb16f 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebKeys.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebKeys.cs @@ -1,9 +1,9 @@ -using Microsoft.IdentityModel.Tokens; -using System.Text.Json.Serialization; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.JsonWebToken; - -public record JsonWebKeys -{ - [JsonPropertyName("keys")] public required JsonWebKey[] Keys; +using Microsoft.IdentityModel.Tokens; +using System.Text.Json.Serialization; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.JsonWebToken; + +public record JsonWebKeys +{ + [JsonPropertyName("keys")] public required JsonWebKey[] Keys; } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebToken.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebToken.cs similarity index 95% rename from PCL.Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebToken.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebToken.cs index dcb63fb15..b2837f313 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebToken.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/JsonWebToken/JsonWebToken.cs @@ -1,272 +1,272 @@ -using System; -using System.Collections.Generic; -using System.IdentityModel.Tokens.Jwt; -using System.Security; -using System.Text.Json; -using Microsoft.IdentityModel.Tokens; -using PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.JsonWebToken; - -/// -/// Json Web Token 类 -/// -/// JWT 令牌字符串 -/// OpenID 元数据 -public class JsonWebToken(string token, OpenIdMetadata meta) -{ - public delegate SecurityToken? TokenValidateCallback(OpenIdMetadata metadata, string token, JsonWebKey? key, string? clientId); - - /// - /// 安全令牌验证回调函数,默认验证签名、发行者、nbf 和 exp - /// - public TokenValidateCallback SecurityTokenValidateCallback { get; set; } = static (meta, token, key, clientId) => - { - try - { - var handler = new JwtSecurityTokenHandler(); - - var parameter = new TokenValidationParameters - { - ValidateIssuer = true, - ValidIssuer = meta.Issuer, - ValidateAudience = !string.IsNullOrEmpty(clientId), - ValidAudience = clientId, - ValidateIssuerSigningKey = key != null, - IssuerSigningKey = key != null ? new JsonWebKeySet { Keys = { key } }.Keys[0] : null, - ValidateLifetime = true, - ClockSkew = TimeSpan.FromSeconds(60) - }; - - handler.ValidateToken(token, parameter, out var secToken); - return secToken; - } - catch (Exception ex) - { - throw new SecurityException($"令牌验证失败:{ex.Message}", ex); - } - }; - - private bool _verified; - private JwtSecurityToken? _parsedToken; - private readonly JwtSecurityTokenHandler _tokenHandler = new(); - - /// - /// 解析令牌(不验证签名) - /// - /// 解析后的 JWT 令牌对象 - /// 令牌格式无效 - private JwtSecurityToken _ParseToken() - { - if (_parsedToken != null) - return _parsedToken; - - try - { - if (!_tokenHandler.CanReadToken(token)) - throw new SecurityException("无法读取令牌:格式无效"); - - _parsedToken = _tokenHandler.ReadJwtToken(token); - return _parsedToken; - } - catch (Exception ex) - { - throw new SecurityException($"令牌解析失败:{ex.Message}", ex); - } - } - - /// - /// 尝试读取 Token 中的字段 - /// - /// 是否允许在未验证的情况下读取字段,若为 false,当 Token 未验证时将抛出异常 - /// 声明值的目标类型 - /// 解析后的声明对象 - /// 未调用 VerifySignature() 且 allowUnverifyToken 为 false - /// 令牌中不存在 payload 数据 - public T? ReadTokenPayload(bool allowUnverifyToken = false) - { - if (!allowUnverifyToken && !_verified) - throw new SecurityException("不安全的令牌"); - - try - { - var jwtToken = _ParseToken(); - - if (jwtToken.Payload == null || jwtToken.Payload.Count == 0) - throw new InvalidOperationException("令牌 Payload 无效"); - - if (typeof(T).IsAssignableFrom(typeof(Dictionary))) - return (T)(object)jwtToken.Payload; - - if (typeof(T) == typeof(JwtPayload)) - return (T)(object)jwtToken.Payload; - - var payloadJson = JsonSerializer.Serialize(jwtToken.Payload); - var result = JsonSerializer.Deserialize(payloadJson); - - return result; - } - catch (SecurityException) - { - throw; - } - catch (Exception ex) - { - throw new SecurityException($"读取令牌 payload 失败:{ex.Message}", ex); - } - } - - /// - /// 读取 Token 头 - /// - /// 声明值的目标类型 - /// 解析后的头对象 - /// 令牌中不存在 header 数据 - public T? ReadTokenHeader() - { - try - { - var jwtToken = _ParseToken(); - - if (jwtToken.Header == null || jwtToken.Header.Count == 0) - throw new InvalidOperationException("令牌中不存在 header 数据"); - - if (typeof(T).IsAssignableFrom(typeof(Dictionary))) - return (T)(object)jwtToken.Header; - - if (typeof(T) == typeof(JwtHeader)) - return (T)(object)jwtToken.Header; - - var headerJson = JsonSerializer.Serialize(jwtToken.Header); - var result = JsonSerializer.Deserialize(headerJson); - - return result; - } - catch (Exception ex) - { - throw new SecurityException($"读取令牌 header 失败:{ex.Message}", ex); - } - } - - /// - /// 对 Token 进行签名验证
- /// 默认情况下仅对签名、iss、nbf、exp 进行验证,如果需要更细粒度验证,请设置 - ///
- /// 用于验证签名的 JSON Web Key - /// 预期的受众(audience),可选 - /// 验证成功返回 SecurityToken 对象,否则返回 null - public SecurityToken? VerifySignature(JsonWebKey key, string? clientId = null) - { - try - { - var result = SecurityTokenValidateCallback.Invoke(meta, token, key, clientId); - if (result != null) - _verified = true; - return result; - } - catch (Exception ex) - { - throw new SecurityException($"令牌签名验证失败:{ex.Message}", ex); - } - } - - /// - /// 重载方法,用于无参调用验证(仅验证基本声明) - /// - /// 验证成功返回 SecurityToken 对象,否则返回 null - public SecurityToken? VerifySignature() - { - try - { - var result = SecurityTokenValidateCallback.Invoke(meta, token, null, null); - if (result != null) - _verified = true; - return result; - } - catch (Exception ex) - { - throw new SecurityException($"令牌验证失败:{ex.Message}", ex); - } - } - - /// - /// 获取令牌的过期时间 - /// - /// 过期时间,若不存在则返回 null - public DateTime? GetExpirationTime() - { - try - { - var jwtToken = _ParseToken(); - return jwtToken.ValidTo != DateTime.MinValue ? jwtToken.ValidTo : null; - } - catch (Exception ex) - { - throw new SecurityException($"获取令牌过期时间失败:{ex.Message}", ex); - } - } - - /// - /// 获取令牌的签发时间 - /// - /// 签发时间,若不存在则返回 null - public DateTime? GetIssuedAtTime() - { - try - { - var jwtToken = _ParseToken(); - return jwtToken.ValidFrom != DateTime.MinValue ? jwtToken.ValidFrom : null; - } - catch (Exception ex) - { - throw new SecurityException($"获取令牌签发时间失败:{ex.Message}", ex); - } - } - - /// - /// 检查令牌是否已过期 - /// - /// 若已过期返回 true,否则返回 false - public bool IsExpired() - { - try - { - var expTime = GetExpirationTime(); - return expTime.HasValue && DateTime.UtcNow > expTime.Value; - } - catch - { - return true; // 如果无法解析,视为已过期 - } - } - - /// - /// 获取特定声明的值 - /// - /// 声明类型 - /// 是否允许在未验证的情况下读取 - /// 声明值,若不存在则返回 null - public string? GetClaimValue(string claimType, bool allowUnverifyToken = false) - { - try - { - var payload = ReadTokenPayload>(allowUnverifyToken); - return payload?.TryGetValue(claimType, out var value) ?? false ? value.ToString() : null; - } - catch (Exception ex) - { - throw new SecurityException($"获取声明值失败({claimType}):{ex.Message}", ex); - } - } - - /// - /// 获取原始令牌字符串 - /// - /// JWT 令牌字符串 - public string GetTokenString() => token; - - /// - /// 检查令牌验证状态 - /// - public bool IsVerified => _verified; -} +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Security; +using System.Text.Json; +using Microsoft.IdentityModel.Tokens; +using PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.JsonWebToken; + +/// +/// Json Web Token 类 +/// +/// JWT 令牌字符串 +/// OpenID 元数据 +public class JsonWebToken(string token, OpenIdMetadata meta) +{ + public delegate SecurityToken? TokenValidateCallback(OpenIdMetadata metadata, string token, JsonWebKey? key, string? clientId); + + /// + /// 安全令牌验证回调函数,默认验证签名、发行者、nbf 和 exp + /// + public TokenValidateCallback SecurityTokenValidateCallback { get; set; } = static (meta, token, key, clientId) => + { + try + { + var handler = new JwtSecurityTokenHandler(); + + var parameter = new TokenValidationParameters + { + ValidateIssuer = true, + ValidIssuer = meta.Issuer, + ValidateAudience = !string.IsNullOrEmpty(clientId), + ValidAudience = clientId, + ValidateIssuerSigningKey = key != null, + IssuerSigningKey = key != null ? new JsonWebKeySet { Keys = { key } }.Keys[0] : null, + ValidateLifetime = true, + ClockSkew = TimeSpan.FromSeconds(60) + }; + + handler.ValidateToken(token, parameter, out var secToken); + return secToken; + } + catch (Exception ex) + { + throw new SecurityException($"令牌验证失败:{ex.Message}", ex); + } + }; + + private bool _verified; + private JwtSecurityToken? _parsedToken; + private readonly JwtSecurityTokenHandler _tokenHandler = new(); + + /// + /// 解析令牌(不验证签名) + /// + /// 解析后的 JWT 令牌对象 + /// 令牌格式无效 + private JwtSecurityToken _ParseToken() + { + if (_parsedToken != null) + return _parsedToken; + + try + { + if (!_tokenHandler.CanReadToken(token)) + throw new SecurityException("无法读取令牌:格式无效"); + + _parsedToken = _tokenHandler.ReadJwtToken(token); + return _parsedToken; + } + catch (Exception ex) + { + throw new SecurityException($"令牌解析失败:{ex.Message}", ex); + } + } + + /// + /// 尝试读取 Token 中的字段 + /// + /// 是否允许在未验证的情况下读取字段,若为 false,当 Token 未验证时将抛出异常 + /// 声明值的目标类型 + /// 解析后的声明对象 + /// 未调用 VerifySignature() 且 allowUnverifyToken 为 false + /// 令牌中不存在 payload 数据 + public T? ReadTokenPayload(bool allowUnverifyToken = false) + { + if (!allowUnverifyToken && !_verified) + throw new SecurityException("不安全的令牌"); + + try + { + var jwtToken = _ParseToken(); + + if (jwtToken.Payload == null || jwtToken.Payload.Count == 0) + throw new InvalidOperationException("令牌 Payload 无效"); + + if (typeof(T).IsAssignableFrom(typeof(Dictionary))) + return (T)(object)jwtToken.Payload; + + if (typeof(T) == typeof(JwtPayload)) + return (T)(object)jwtToken.Payload; + + var payloadJson = JsonSerializer.Serialize(jwtToken.Payload); + var result = JsonSerializer.Deserialize(payloadJson); + + return result; + } + catch (SecurityException) + { + throw; + } + catch (Exception ex) + { + throw new SecurityException($"读取令牌 payload 失败:{ex.Message}", ex); + } + } + + /// + /// 读取 Token 头 + /// + /// 声明值的目标类型 + /// 解析后的头对象 + /// 令牌中不存在 header 数据 + public T? ReadTokenHeader() + { + try + { + var jwtToken = _ParseToken(); + + if (jwtToken.Header == null || jwtToken.Header.Count == 0) + throw new InvalidOperationException("令牌中不存在 header 数据"); + + if (typeof(T).IsAssignableFrom(typeof(Dictionary))) + return (T)(object)jwtToken.Header; + + if (typeof(T) == typeof(JwtHeader)) + return (T)(object)jwtToken.Header; + + var headerJson = JsonSerializer.Serialize(jwtToken.Header); + var result = JsonSerializer.Deserialize(headerJson); + + return result; + } + catch (Exception ex) + { + throw new SecurityException($"读取令牌 header 失败:{ex.Message}", ex); + } + } + + /// + /// 对 Token 进行签名验证
+ /// 默认情况下仅对签名、iss、nbf、exp 进行验证,如果需要更细粒度验证,请设置 + ///
+ /// 用于验证签名的 JSON Web Key + /// 预期的受众(audience),可选 + /// 验证成功返回 SecurityToken 对象,否则返回 null + public SecurityToken? VerifySignature(JsonWebKey key, string? clientId = null) + { + try + { + var result = SecurityTokenValidateCallback.Invoke(meta, token, key, clientId); + if (result != null) + _verified = true; + return result; + } + catch (Exception ex) + { + throw new SecurityException($"令牌签名验证失败:{ex.Message}", ex); + } + } + + /// + /// 重载方法,用于无参调用验证(仅验证基本声明) + /// + /// 验证成功返回 SecurityToken 对象,否则返回 null + public SecurityToken? VerifySignature() + { + try + { + var result = SecurityTokenValidateCallback.Invoke(meta, token, null, null); + if (result != null) + _verified = true; + return result; + } + catch (Exception ex) + { + throw new SecurityException($"令牌验证失败:{ex.Message}", ex); + } + } + + /// + /// 获取令牌的过期时间 + /// + /// 过期时间,若不存在则返回 null + public DateTime? GetExpirationTime() + { + try + { + var jwtToken = _ParseToken(); + return jwtToken.ValidTo != DateTime.MinValue ? jwtToken.ValidTo : null; + } + catch (Exception ex) + { + throw new SecurityException($"获取令牌过期时间失败:{ex.Message}", ex); + } + } + + /// + /// 获取令牌的签发时间 + /// + /// 签发时间,若不存在则返回 null + public DateTime? GetIssuedAtTime() + { + try + { + var jwtToken = _ParseToken(); + return jwtToken.ValidFrom != DateTime.MinValue ? jwtToken.ValidFrom : null; + } + catch (Exception ex) + { + throw new SecurityException($"获取令牌签发时间失败:{ex.Message}", ex); + } + } + + /// + /// 检查令牌是否已过期 + /// + /// 若已过期返回 true,否则返回 false + public bool IsExpired() + { + try + { + var expTime = GetExpirationTime(); + return expTime.HasValue && DateTime.UtcNow > expTime.Value; + } + catch + { + return true; // 如果无法解析,视为已过期 + } + } + + /// + /// 获取特定声明的值 + /// + /// 声明类型 + /// 是否允许在未验证的情况下读取 + /// 声明值,若不存在则返回 null + public string? GetClaimValue(string claimType, bool allowUnverifyToken = false) + { + try + { + var payload = ReadTokenPayload>(allowUnverifyToken); + return payload?.TryGetValue(claimType, out var value) ?? false ? value.ToString() : null; + } + catch (Exception ex) + { + throw new SecurityException($"获取声明值失败({claimType}):{ex.Message}", ex); + } + } + + /// + /// 获取原始令牌字符串 + /// + /// JWT 令牌字符串 + public string GetTokenString() => token; + + /// + /// 检查令牌验证状态 + /// + public bool IsVerified => _verified; +} diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdClient.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdClient.cs similarity index 93% rename from PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdClient.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdClient.cs index 66118be49..4c4e64bf2 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdClient.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdClient.cs @@ -1,96 +1,96 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using PCL.Core.Minecraft.IdentityModel.Extensions.Pkce; -using PCL.Core.Minecraft.IdentityModel.OAuth; -using PCL.Core.Utils.Exts; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; - -public class OpenIdClient(OpenIdOptions options):IOAuthClient -{ - private IOAuthClient? _client; - /// - /// 初始化并从网络加载 OpenId 配置 - /// - /// - /// - /// 当要求检查地址并不存在任何授权端点时,将触发此错误 - public async Task InitializeAsync(CancellationToken token,bool checkAddress = false) - { - var opt = await options.BuildOAuthOptionsAsync(token); - if (!checkAddress || opt.Meta.AuthorizeEndpoint.IsNullOrEmpty() || opt.Meta.DeviceEndpoint.IsNullOrEmpty()) - { - _client = options.EnablePkceSupport ? new PkceClient(opt) : new SimpleOAuthClient(opt); - return; - } - - throw new InvalidOperationException(); - } - /// - /// 获取授权代码流地址 - /// - /// 权限列表 - /// - /// 扩展数据 - /// - /// 未调用 - public string GetAuthorizeUrl(string[] scopes, string state,Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return _client.GetAuthorizeUrl(scopes, state, extData); - } - /// - /// 使用授权代码兑换 Token - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithCodeAsync(string code, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.AuthorizeWithCodeAsync(code, token, extData); - } - /// - /// 获取设备代码流代码对 - /// - /// - /// - /// - /// - /// - public async Task GetCodePairAsync(string[] scopes, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.GetCodePairAsync(scopes, token, extData); - } - /// - /// 发起一次验证,以检查认证是否成功 - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithDeviceAsync(DeviceCodeData data, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.AuthorizeWithDeviceAsync(data, token, extData); - } - /// - /// 进行一次刷新调用 - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithSilentAsync(AuthorizeResult data, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.AuthorizeWithSilentAsync(data, token, extData); - } -} +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using PCL.CE.Core.Minecraft.IdentityModel.Extensions.Pkce; +using PCL.CE.Core.Minecraft.IdentityModel.OAuth; +using PCL.CE.Core.Utils.Exts; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; + +public class OpenIdClient(OpenIdOptions options):IOAuthClient +{ + private IOAuthClient? _client; + /// + /// 初始化并从网络加载 OpenId 配置 + /// + /// + /// + /// 当要求检查地址并不存在任何授权端点时,将触发此错误 + public async Task InitializeAsync(CancellationToken token,bool checkAddress = false) + { + var opt = await options.BuildOAuthOptionsAsync(token); + if (!checkAddress || opt.Meta.AuthorizeEndpoint.IsNullOrEmpty() || opt.Meta.DeviceEndpoint.IsNullOrEmpty()) + { + _client = options.EnablePkceSupport ? new PkceClient(opt) : new SimpleOAuthClient(opt); + return; + } + + throw new InvalidOperationException(); + } + /// + /// 获取授权代码流地址 + /// + /// 权限列表 + /// + /// 扩展数据 + /// + /// 未调用 + public string GetAuthorizeUrl(string[] scopes, string state,Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return _client.GetAuthorizeUrl(scopes, state, extData); + } + /// + /// 使用授权代码兑换 Token + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithCodeAsync(string code, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.AuthorizeWithCodeAsync(code, token, extData); + } + /// + /// 获取设备代码流代码对 + /// + /// + /// + /// + /// + /// + public async Task GetCodePairAsync(string[] scopes, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.GetCodePairAsync(scopes, token, extData); + } + /// + /// 发起一次验证,以检查认证是否成功 + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithDeviceAsync(DeviceCodeData data, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.AuthorizeWithDeviceAsync(data, token, extData); + } + /// + /// 进行一次刷新调用 + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithSilentAsync(AuthorizeResult data, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.AuthorizeWithSilentAsync(data, token, extData); + } +} diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdMetaData.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdMetaData.cs similarity index 92% rename from PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdMetaData.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdMetaData.cs index 151a5de0a..091a52282 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdMetaData.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdMetaData.cs @@ -1,41 +1,41 @@ -using System.Collections.Generic; -using System.Text.Json.Serialization; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; - - - -public record OpenIdMetadata -{ - [JsonPropertyName("issuer")] - public required string Issuer { get; init; } - - [JsonPropertyName("authorization_endpoint")] - public string? AuthorizationEndpoint { get; init; } - - [JsonPropertyName("device_authorization_endpoint")] - public string? DeviceAuthorizationEndpoint { get; init; } - - [JsonPropertyName("token_endpoint")] - public required string TokenEndpoint { get; init; } - - [JsonPropertyName("userinfo_endpoint")] - public required string UserInfoEndpoint { get; init; } - - [JsonPropertyName("registration_endpoint")] - public string? RegistrationEndpoint { get; init; } - - [JsonPropertyName("jwks_uri")] - public required string JwksUri { get; init; } - - [JsonPropertyName("scopes_supported")] - public required IReadOnlyList ScopesSupported { get; init; } - - [JsonPropertyName("subject_types_supported")] - public required IReadOnlyList SubjectTypesSupported { get; init; } - - [JsonPropertyName("id_token_signing_alg_values_supported")] - public required IReadOnlyList IdTokenSigningAlgValuesSupported { get; init; } - - +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; + + + +public record OpenIdMetadata +{ + [JsonPropertyName("issuer")] + public required string Issuer { get; init; } + + [JsonPropertyName("authorization_endpoint")] + public string? AuthorizationEndpoint { get; init; } + + [JsonPropertyName("device_authorization_endpoint")] + public string? DeviceAuthorizationEndpoint { get; init; } + + [JsonPropertyName("token_endpoint")] + public required string TokenEndpoint { get; init; } + + [JsonPropertyName("userinfo_endpoint")] + public required string UserInfoEndpoint { get; init; } + + [JsonPropertyName("registration_endpoint")] + public string? RegistrationEndpoint { get; init; } + + [JsonPropertyName("jwks_uri")] + public required string JwksUri { get; init; } + + [JsonPropertyName("scopes_supported")] + public required IReadOnlyList ScopesSupported { get; init; } + + [JsonPropertyName("subject_types_supported")] + public required IReadOnlyList SubjectTypesSupported { get; init; } + + [JsonPropertyName("id_token_signing_alg_values_supported")] + public required IReadOnlyList IdTokenSigningAlgValuesSupported { get; init; } + + } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdOptions.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdOptions.cs similarity index 92% rename from PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdOptions.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdOptions.cs index e1595bdcb..3e122a34a 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdOptions.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/OpenId/OpenIdOptions.cs @@ -1,118 +1,118 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.IdentityModel.Tokens; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Minecraft.IdentityModel.Extensions.JsonWebToken; -using PCL.Core.Minecraft.IdentityModel.OAuth; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; - -public record OpenIdOptions -{ - /// - /// OpenId Discovery 地址 - /// - public required string OpenIdDiscoveryAddress { get; set; } - /// - /// 客户端 ID(必须设置) - /// - public required string ClientId - { - get; - set; - } - - // 为了让 YggdrasilConnect Client 复用代码做的逻辑 - - /// - /// 是否只使用设备代码流授权 - /// - public bool OnlyDeviceAuthorize { get; set; } - /// - /// 回调 Uri - /// - public string? RedirectUri { get; set; } - /// - /// 发送 HTTP 请求时设置的请求头,仅适用于请求头(丢到 HttpRequestMessage 不会报错的那种) - /// - public Dictionary? Headers { get; set; } - /// - /// 是否启用 PKCE 支持,默认启用 - /// - public bool EnablePkceSupport { get; set; } = true; - /// - /// 获取 HttpClient,生命周期由调用方管理 - /// - public required Func GetClient { get; set; } - /// - /// OpenId 元数据,请勿自行设置此属性,而是应该调用 - /// - public OpenIdMetadata? Meta { get; internal set; } - - /// - /// 从互联网拉取 OpenID 配置信息 - /// - /// - public virtual async Task InitializeAsync(CancellationToken token) - { - using var response = await HttpRequest - .Create(OpenIdDiscoveryAddress) - .WithHeaders(Headers ?? []) - .SendAsync(GetClient.Invoke(), cancellationToken: token) - .ConfigureAwait(false); - - Meta = await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 获取 Json Web Key - /// - /// 密钥 ID - /// - /// - /// 未调用 - /// 找不到 Jwk 或 Jwk 配置无效 - public async Task GetSignatureKeyAsync(string kid,CancellationToken token) - { - if (Meta?.JwksUri is null) throw new InvalidOperationException(); - using var response = await HttpRequest.Create(Meta.JwksUri) - .WithHeaders(Headers ?? []) - .SendAsync(GetClient.Invoke()) - .ConfigureAwait(false); - - var result = await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - return result?.Keys.Single(k => k.Kid == kid) - ?? throw new FormatException(); - } - /// - /// 构建 OAuth 客户端配置 - /// - /// - /// - /// 未调用 - public virtual async Task BuildOAuthOptionsAsync(CancellationToken token) - { - if (Meta is null) throw new InvalidOperationException(); - if(!OnlyDeviceAuthorize) ArgumentException.ThrowIfNullOrEmpty(RedirectUri); - return new OAuthClientOptions - { - GetClient = GetClient, - ClientId = ClientId, - RedirectUri = OnlyDeviceAuthorize ? string.Empty:RedirectUri!, - Meta = new EndpointMeta - { - AuthorizeEndpoint = Meta?.AuthorizationEndpoint??string.Empty, - DeviceEndpoint = Meta?.DeviceAuthorizationEndpoint??string.Empty, - TokenEndpoint = Meta!.TokenEndpoint, - } - }; - } - -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.IdentityModel.Tokens; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Minecraft.IdentityModel.Extensions.JsonWebToken; +using PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; + +public record OpenIdOptions +{ + /// + /// OpenId Discovery 地址 + /// + public required string OpenIdDiscoveryAddress { get; set; } + /// + /// 客户端 ID(必须设置) + /// + public required string ClientId + { + get; + set; + } + + // 为了让 YggdrasilConnect Client 复用代码做的逻辑 + + /// + /// 是否只使用设备代码流授权 + /// + public bool OnlyDeviceAuthorize { get; set; } + /// + /// 回调 Uri + /// + public string? RedirectUri { get; set; } + /// + /// 发送 HTTP 请求时设置的请求头,仅适用于请求头(丢到 HttpRequestMessage 不会报错的那种) + /// + public Dictionary? Headers { get; set; } + /// + /// 是否启用 PKCE 支持,默认启用 + /// + public bool EnablePkceSupport { get; set; } = true; + /// + /// 获取 HttpClient,生命周期由调用方管理 + /// + public required Func GetClient { get; set; } + /// + /// OpenId 元数据,请勿自行设置此属性,而是应该调用 + /// + public OpenIdMetadata? Meta { get; internal set; } + + /// + /// 从互联网拉取 OpenID 配置信息 + /// + /// + public virtual async Task InitializeAsync(CancellationToken token) + { + using var response = await HttpRequest + .Create(OpenIdDiscoveryAddress) + .WithHeaders(Headers ?? []) + .SendAsync(GetClient.Invoke(), cancellationToken: token) + .ConfigureAwait(false); + + Meta = await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 获取 Json Web Key + /// + /// 密钥 ID + /// + /// + /// 未调用 + /// 找不到 Jwk 或 Jwk 配置无效 + public async Task GetSignatureKeyAsync(string kid,CancellationToken token) + { + if (Meta?.JwksUri is null) throw new InvalidOperationException(); + using var response = await HttpRequest.Create(Meta.JwksUri) + .WithHeaders(Headers ?? []) + .SendAsync(GetClient.Invoke()) + .ConfigureAwait(false); + + var result = await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + return result?.Keys.Single(k => k.Kid == kid) + ?? throw new FormatException(); + } + /// + /// 构建 OAuth 客户端配置 + /// + /// + /// + /// 未调用 + public virtual async Task BuildOAuthOptionsAsync(CancellationToken token) + { + if (Meta is null) throw new InvalidOperationException(); + if(!OnlyDeviceAuthorize) ArgumentException.ThrowIfNullOrEmpty(RedirectUri); + return new OAuthClientOptions + { + GetClient = GetClient, + ClientId = ClientId, + RedirectUri = OnlyDeviceAuthorize ? string.Empty:RedirectUri!, + Meta = new EndpointMeta + { + AuthorizeEndpoint = Meta?.AuthorizationEndpoint??string.Empty, + DeviceEndpoint = Meta?.DeviceAuthorizationEndpoint??string.Empty, + TokenEndpoint = Meta!.TokenEndpoint, + } + }; + } + +} diff --git a/PCL.CE/Core/Minecraft/IdentityModel/Extensions/Pkce/PkceChallengeOptions.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/Pkce/PkceChallengeOptions.cs new file mode 100644 index 000000000..99d5c4f86 --- /dev/null +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/Pkce/PkceChallengeOptions.cs @@ -0,0 +1,7 @@ +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.Pkce; + +public enum PkceChallengeOptions +{ + Sha256, + PlainText +} \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/Pkce/PkceClient.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/Pkce/PkceClient.cs similarity index 93% rename from PCL.Core/Minecraft/IdentityModel/Extensions/Pkce/PkceClient.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/Pkce/PkceClient.cs index 4ef2e8d38..f54afa91c 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/Pkce/PkceClient.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/Pkce/PkceClient.cs @@ -1,88 +1,88 @@ -using System; -using PCL.Core.Utils.Exts; -using System.Collections.Generic; -using System.Security.Cryptography; -using System.Threading; -using System.Threading.Tasks; -using PCL.Core.Minecraft.IdentityModel.OAuth; -using PCL.Core.Utils.Hash; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.Pkce; - -/// -/// 带 PKCE 支持的客户端
-/// 此客户端并非线程安全,请勿在多个线程间共享示例 -///
-/// -public class PkceClient(OAuthClientOptions options):IOAuthClient -{ - private byte[] _ChallengeCode { get; set; } = new byte[32]; - private bool _isCallGetAuthorizeUrl; - /// - /// 设置验证方法,支持 PlainText 和 SHA256 - /// - public PkceChallengeOptions ChallengeMethod { get; private set; } = PkceChallengeOptions.Sha256; - private readonly SimpleOAuthClient _client = new(options); - /// - /// 获取授权地址 - /// - /// - /// - /// - /// - public string GetAuthorizeUrl(string[] scopes, string state, Dictionary? extData) - { - RandomNumberGenerator.Fill(_ChallengeCode); - extData ??= []; - extData["code_challenge"] = ChallengeMethod == PkceChallengeOptions.Sha256 - ? SHA256Provider.Instance.ComputeHash(_ChallengeCode).ToHexString() - : _ChallengeCode.FromBytesToB64UrlSafe(); - extData["code_challenge_method"] = ChallengeMethod == PkceChallengeOptions.Sha256 ? "S256":"plain"; - _isCallGetAuthorizeUrl = true; - return _client.GetAuthorizeUrl(scopes, state, extData); - } - /// - /// 使用授权代码兑换令牌 - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithCodeAsync(string code, CancellationToken token, Dictionary? extData = null) - { - if (!_isCallGetAuthorizeUrl) throw new InvalidOperationException("Challenge code is invalid"); - var pkce = _ChallengeCode.FromBytesToB64UrlSafe(); - extData ??= []; - extData["code_verifier"] = pkce; - _isCallGetAuthorizeUrl = false; - return await _client.AuthorizeWithCodeAsync(code, token, extData); - } - /// - /// 获取代码对 - /// - /// - /// - /// - /// - public async Task GetCodePairAsync(string[] scopes, CancellationToken token, Dictionary? extData = null) - { - return await _client.GetCodePairAsync(scopes, token, extData); - } - /// - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithDeviceAsync(DeviceCodeData data, CancellationToken token, Dictionary? extData = null) - { - return await _client.AuthorizeWithDeviceAsync(data, token, extData); - } - - public async Task AuthorizeWithSilentAsync(AuthorizeResult data, CancellationToken token, Dictionary? extData = null) - { - return await _client.AuthorizeWithSilentAsync(data, token, extData); - } -} +using System; +using PCL.CE.Core.Utils.Exts; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Threading; +using System.Threading.Tasks; +using PCL.CE.Core.Minecraft.IdentityModel.OAuth; +using PCL.CE.Core.Utils.Hash; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.Pkce; + +/// +/// 带 PKCE 支持的客户端
+/// 此客户端并非线程安全,请勿在多个线程间共享示例 +///
+/// +public class PkceClient(OAuthClientOptions options):IOAuthClient +{ + private byte[] _ChallengeCode { get; set; } = new byte[32]; + private bool _isCallGetAuthorizeUrl; + /// + /// 设置验证方法,支持 PlainText 和 SHA256 + /// + public PkceChallengeOptions ChallengeMethod { get; private set; } = PkceChallengeOptions.Sha256; + private readonly SimpleOAuthClient _client = new(options); + /// + /// 获取授权地址 + /// + /// + /// + /// + /// + public string GetAuthorizeUrl(string[] scopes, string state, Dictionary? extData) + { + RandomNumberGenerator.Fill(_ChallengeCode); + extData ??= []; + extData["code_challenge"] = ChallengeMethod == PkceChallengeOptions.Sha256 + ? SHA256Provider.Instance.ComputeHash(_ChallengeCode).ToHexString() + : _ChallengeCode.FromBytesToB64UrlSafe(); + extData["code_challenge_method"] = ChallengeMethod == PkceChallengeOptions.Sha256 ? "S256":"plain"; + _isCallGetAuthorizeUrl = true; + return _client.GetAuthorizeUrl(scopes, state, extData); + } + /// + /// 使用授权代码兑换令牌 + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithCodeAsync(string code, CancellationToken token, Dictionary? extData = null) + { + if (!_isCallGetAuthorizeUrl) throw new InvalidOperationException("Challenge code is invalid"); + var pkce = _ChallengeCode.FromBytesToB64UrlSafe(); + extData ??= []; + extData["code_verifier"] = pkce; + _isCallGetAuthorizeUrl = false; + return await _client.AuthorizeWithCodeAsync(code, token, extData); + } + /// + /// 获取代码对 + /// + /// + /// + /// + /// + public async Task GetCodePairAsync(string[] scopes, CancellationToken token, Dictionary? extData = null) + { + return await _client.GetCodePairAsync(scopes, token, extData); + } + /// + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithDeviceAsync(DeviceCodeData data, CancellationToken token, Dictionary? extData = null) + { + return await _client.AuthorizeWithDeviceAsync(data, token, extData); + } + + public async Task AuthorizeWithSilentAsync(AuthorizeResult data, CancellationToken token, Dictionary? extData = null) + { + return await _client.AuthorizeWithSilentAsync(data, token, extData); + } +} diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilClient.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilClient.cs similarity index 93% rename from PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilClient.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilClient.cs index 808aec660..e674a12bf 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilClient.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilClient.cs @@ -1,104 +1,104 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; -using PCL.Core.Minecraft.IdentityModel.OAuth; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.YggdrasilConnect; - -// Steven Qiu 说这东西完全就是 OpenId + 魔改了一部分,所以可以直接复用 OpenId 的逻辑 - -/// -/// -/// -public class YggdrasilClient:IOAuthClient -{ - - private OpenIdClient? _client; - - private YggdrasilOptions _options; - - public YggdrasilClient(YggdrasilOptions options) - { - _options = options; - } - /// - /// 初始化并拉取网络配置 - /// - /// 当无法获取 ClientId 时抛出,调用方应该设置 ClientId 并重新实例化 Client - /// - public async Task InitializeAsync(CancellationToken token) - { - _client = new OpenIdClient(_options); - await _client.InitializeAsync(token,true); - } - /// - /// 获取授权端点地址 - /// - /// - /// - /// - /// - /// 未调用 - public string GetAuthorizeUrl(string[] scopes, string state, Dictionary? extData) - { - if (_client is null) throw new InvalidOperationException(); - return _client.GetAuthorizeUrl(scopes, state, extData); - } - /// - /// 使用授权代码兑换令牌 - /// - /// - /// - /// - /// - /// 未调用 - public async Task AuthorizeWithCodeAsync(string code, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.AuthorizeWithCodeAsync(code, token, extData); - - } - /// - /// 获取代码对 - /// - /// - /// - /// - /// - /// 未调用 - public async Task GetCodePairAsync(string[] scopes, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.GetCodePairAsync(scopes, token, extData); - - } - /// - /// 发起一次请求验证用户授权状态 - /// - /// - /// - /// - /// - /// 未调用 - public async Task AuthorizeWithDeviceAsync(DeviceCodeData data, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.AuthorizeWithDeviceAsync(data, token, extData); - - } - /// - /// 刷新登录 - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithSilentAsync(AuthorizeResult data, CancellationToken token, Dictionary? extData = null) - { - if (_client is null) throw new InvalidOperationException(); - return await _client.AuthorizeWithSilentAsync(data, token, extData); - } -} +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; +using PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.YggdrasilConnect; + +// Steven Qiu 说这东西完全就是 OpenId + 魔改了一部分,所以可以直接复用 OpenId 的逻辑 + +/// +/// +/// +public class YggdrasilClient:IOAuthClient +{ + + private OpenIdClient? _client; + + private YggdrasilOptions _options; + + public YggdrasilClient(YggdrasilOptions options) + { + _options = options; + } + /// + /// 初始化并拉取网络配置 + /// + /// 当无法获取 ClientId 时抛出,调用方应该设置 ClientId 并重新实例化 Client + /// + public async Task InitializeAsync(CancellationToken token) + { + _client = new OpenIdClient(_options); + await _client.InitializeAsync(token,true); + } + /// + /// 获取授权端点地址 + /// + /// + /// + /// + /// + /// 未调用 + public string GetAuthorizeUrl(string[] scopes, string state, Dictionary? extData) + { + if (_client is null) throw new InvalidOperationException(); + return _client.GetAuthorizeUrl(scopes, state, extData); + } + /// + /// 使用授权代码兑换令牌 + /// + /// + /// + /// + /// + /// 未调用 + public async Task AuthorizeWithCodeAsync(string code, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.AuthorizeWithCodeAsync(code, token, extData); + + } + /// + /// 获取代码对 + /// + /// + /// + /// + /// + /// 未调用 + public async Task GetCodePairAsync(string[] scopes, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.GetCodePairAsync(scopes, token, extData); + + } + /// + /// 发起一次请求验证用户授权状态 + /// + /// + /// + /// + /// + /// 未调用 + public async Task AuthorizeWithDeviceAsync(DeviceCodeData data, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.AuthorizeWithDeviceAsync(data, token, extData); + + } + /// + /// 刷新登录 + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithSilentAsync(AuthorizeResult data, CancellationToken token, Dictionary? extData = null) + { + if (_client is null) throw new InvalidOperationException(); + return await _client.AuthorizeWithSilentAsync(data, token, extData); + } +} diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilConnectMetaData.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilConnectMetaData.cs similarity index 58% rename from PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilConnectMetaData.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilConnectMetaData.cs index 539915432..11d518e2b 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilConnectMetaData.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilConnectMetaData.cs @@ -1,10 +1,10 @@ -using System.Text.Json.Serialization; -using PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.YggdrasilConnect; - -public record YggdrasilConnectMetaData: OpenIdMetadata -{ - [JsonPropertyName("shared_client_id")] - public string? SharedClientId { get; init; } +using System.Text.Json.Serialization; +using PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.YggdrasilConnect; + +public record YggdrasilConnectMetaData: OpenIdMetadata +{ + [JsonPropertyName("shared_client_id")] + public string? SharedClientId { get; init; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilOptions.cs b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilOptions.cs similarity index 86% rename from PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilOptions.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilOptions.cs index 6d0672a2d..62d1e32d7 100644 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilOptions.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Extensions/YggdrasilConnect/YggdrasilOptions.cs @@ -1,60 +1,60 @@ -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Minecraft.IdentityModel.Extensions.OpenId; -using PCL.Core.Minecraft.IdentityModel.OAuth; -using PCL.Core.Utils.Exts; - -namespace PCL.Core.Minecraft.IdentityModel.Extensions.YggdrasilConnect; - -public record YggdrasilOptions:OpenIdOptions -{ - private string[] _scopesRequired = ["openid", "Yggdrasil.PlayerProfiles.Select", "Yggdrasil.Server.Join"]; - - // 重写这个鬼方法是因为 Yggdrasil Connect 有要求( - - /// - /// 拉取 Yggdrasil 配置 - /// - /// - /// - public override async Task InitializeAsync(CancellationToken token) - { - using var response = await HttpRequest - .Create(OpenIdDiscoveryAddress) - .WithHeaders(Headers ?? []) - .SendAsync(GetClient.Invoke()) - .ConfigureAwait(false); - - Meta = (await response.AsJsonAsync().ConfigureAwait(false)) - ?? throw new InvalidOperationException(); - if (_scopesRequired.Except(Meta.ScopesSupported).Any()) throw new InvalidOperationException(); - } - /// - /// 构建 OAuth 客户端选项 - /// - /// - /// - /// 未调用 - /// - /// - public override async Task BuildOAuthOptionsAsync(CancellationToken token) - { - if (Meta is YggdrasilConnectMetaData meta) - { - var options = await base.BuildOAuthOptionsAsync(token); - if (!options.ClientId.IsNullOrEmpty()) return options; - if (meta is null) throw new InvalidOperationException(); - if (!meta.SharedClientId.IsNullOrEmpty()) - { - options.ClientId = meta.SharedClientId; - } - - throw new ArgumentException(); - } - - throw new InvalidCastException(); - } +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Minecraft.IdentityModel.Extensions.OpenId; +using PCL.CE.Core.Minecraft.IdentityModel.OAuth; +using PCL.CE.Core.Utils.Exts; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Extensions.YggdrasilConnect; + +public record YggdrasilOptions:OpenIdOptions +{ + private string[] _scopesRequired = ["openid", "Yggdrasil.PlayerProfiles.Select", "Yggdrasil.Server.Join"]; + + // 重写这个鬼方法是因为 Yggdrasil Connect 有要求( + + /// + /// 拉取 Yggdrasil 配置 + /// + /// + /// + public override async Task InitializeAsync(CancellationToken token) + { + using var response = await HttpRequest + .Create(OpenIdDiscoveryAddress) + .WithHeaders(Headers ?? []) + .SendAsync(GetClient.Invoke()) + .ConfigureAwait(false); + + Meta = (await response.AsJsonAsync().ConfigureAwait(false)) + ?? throw new InvalidOperationException(); + if (_scopesRequired.Except(Meta.ScopesSupported).Any()) throw new InvalidOperationException(); + } + /// + /// 构建 OAuth 客户端选项 + /// + /// + /// + /// 未调用 + /// + /// + public override async Task BuildOAuthOptionsAsync(CancellationToken token) + { + if (Meta is YggdrasilConnectMetaData meta) + { + var options = await base.BuildOAuthOptionsAsync(token); + if (!options.ClientId.IsNullOrEmpty()) return options; + if (meta is null) throw new InvalidOperationException(); + if (!meta.SharedClientId.IsNullOrEmpty()) + { + options.ClientId = meta.SharedClientId; + } + + throw new ArgumentException(); + } + + throw new InvalidCastException(); + } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/OAuth/AuthorizeResult.cs b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/AuthorizeResult.cs similarity index 91% rename from PCL.Core/Minecraft/IdentityModel/OAuth/AuthorizeResult.cs rename to PCL.CE/Core/Minecraft/IdentityModel/OAuth/AuthorizeResult.cs index 4b46d4508..57d2b6298 100644 --- a/PCL.Core/Minecraft/IdentityModel/OAuth/AuthorizeResult.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/AuthorizeResult.cs @@ -1,40 +1,40 @@ -using System.Text.Json.Serialization; -using PCL.Core.Utils.Exts; - -namespace PCL.Core.Minecraft.IdentityModel.OAuth; - -public record AuthorizeResult -{ - public bool IsError => !Error.IsNullOrEmpty(); - /// - /// 错误类型 (e.g. invalid_request) - /// - [JsonPropertyName("error")] public string? Error { get; init; } - /// - /// 描述此错误的文本 - /// - [JsonPropertyName("error_description")] public string? ErrorDescription { get; init; } - - // 不用 SecureString,因为这东西依赖 DPAPI,不是最佳实践 - - /// - /// 访问令牌 - /// - [JsonPropertyName("access_token")] public string? AccessToken { get; init; } - /// - /// 刷新令牌 - /// - [JsonPropertyName("refresh_token")] public string? RefreshToken { get; init; } - /// - /// ID Token - /// - [JsonPropertyName("id_token")] public string? IdToken { get; init; } - /// - /// 令牌类型 - /// - [JsonPropertyName("token_type")] public string? TokenType { get; init; } - /// - /// 过期时间 - /// - [JsonPropertyName("expires_in")] public int? ExpiresIn { get; init; } +using System.Text.Json.Serialization; +using PCL.CE.Core.Utils.Exts; + +namespace PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +public record AuthorizeResult +{ + public bool IsError => !Error.IsNullOrEmpty(); + /// + /// 错误类型 (e.g. invalid_request) + /// + [JsonPropertyName("error")] public string? Error { get; init; } + /// + /// 描述此错误的文本 + /// + [JsonPropertyName("error_description")] public string? ErrorDescription { get; init; } + + // 不用 SecureString,因为这东西依赖 DPAPI,不是最佳实践 + + /// + /// 访问令牌 + /// + [JsonPropertyName("access_token")] public string? AccessToken { get; init; } + /// + /// 刷新令牌 + /// + [JsonPropertyName("refresh_token")] public string? RefreshToken { get; init; } + /// + /// ID Token + /// + [JsonPropertyName("id_token")] public string? IdToken { get; init; } + /// + /// 令牌类型 + /// + [JsonPropertyName("token_type")] public string? TokenType { get; init; } + /// + /// 过期时间 + /// + [JsonPropertyName("expires_in")] public int? ExpiresIn { get; init; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/OAuth/Client.cs b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/Client.cs similarity index 96% rename from PCL.Core/Minecraft/IdentityModel/OAuth/Client.cs rename to PCL.CE/Core/Minecraft/IdentityModel/OAuth/Client.cs index f7d3e5493..50034bfee 100644 --- a/PCL.Core/Minecraft/IdentityModel/OAuth/Client.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/Client.cs @@ -1,155 +1,155 @@ -using System; -using System.Text; -using System.Net.Http; -using System.Text.Json; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Threading; -using PCL.Core.IO.Net.Http.Client.Request; - -namespace PCL.Core.Minecraft.IdentityModel.OAuth; - -/// -/// OAuth 客户端实现,配合 Polly 食用效果更佳 -/// -/// OAuth 参数 -public sealed class SimpleOAuthClient(OAuthClientOptions options):IOAuthClient -{ - /// - /// 获取授权 Url - /// - /// 访问权限列表 - /// - /// - /// - public string GetAuthorizeUrl(string[] scopes,string state,Dictionary? extData = null) - { - ArgumentException.ThrowIfNullOrWhiteSpace(options.Meta.AuthorizeEndpoint); - var sb = new StringBuilder(); - sb.Append(options.Meta.AuthorizeEndpoint); - sb.Append($"?response_type=code&scope={Uri.EscapeDataString(string.Join(" ", scopes))}"); - sb.Append($"&redirect_uri={Uri.EscapeDataString(options.RedirectUri)}"); - sb.Append($"&client_id={options.ClientId}&state={state}"); - if (extData is null) return sb.ToString(); - foreach (var kvp in extData) - sb.Append($"&{kvp.Key}={Uri.EscapeDataString(kvp.Value)}"); - return sb.ToString(); - } - - /// - /// 使用授权代码获取令牌 - /// - /// 授权代码 - /// 附加属性,不应该包含必须参数和预定义字段 (e.g. client_id、grant_type) - /// - /// - public async Task AuthorizeWithCodeAsync( - string code,CancellationToken token,Dictionary? extData = null - ) - { - extData ??= new Dictionary(); - extData["client_id"] = options.ClientId; - extData["grant_type"] = "authorization_code"; - extData["code"] = code; - var client = options.GetClient.Invoke(); - using var content = new FormUrlEncodedContent(extData); - using var response = await HttpRequest - .CreatePost(options.Meta.TokenEndpoint) - .WithContent(content) - .WithHeaders(options.Headers ?? []) - .SendAsync(client, cancellationToken: token) - .ConfigureAwait(false); - var result = await response.Content.ReadAsStringAsync(token); - return await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 获取设备代码对 - /// - /// - /// - /// - /// - public async Task GetCodePairAsync - (string[] scopes,CancellationToken token, Dictionary? extData = null) - { - ArgumentException.ThrowIfNullOrEmpty(options.Meta.DeviceEndpoint); - var client = options.GetClient.Invoke(); - extData ??= new Dictionary(); - extData["scope"] = string.Join(" ", scopes); - extData["client_id"] = options.ClientId; - var content = new FormUrlEncodedContent(extData); - - using var response = await HttpRequest - .CreatePost(options.Meta.DeviceEndpoint) - .WithContent(content) - .WithHeaders(options.Headers ?? []) - .SendAsync(client, cancellationToken: token) - .ConfigureAwait(false); - - return await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 验证用户授权状态
- /// 注:此方法不会检查是否过去了 Interval 秒,请自行处理 - ///
- /// - /// - /// - /// - /// - public async Task AuthorizeWithDeviceAsync - (DeviceCodeData data,CancellationToken token,Dictionary? extData = null) - { - if (data.IsError) throw new OperationCanceledException(data.ErrorDescription); - var client = options.GetClient.Invoke(); - extData ??= new Dictionary(); - extData["client_id"] = options.ClientId; - extData["grant_type"] = "urn:ietf:params:oauth:grant-type:device_code"; - extData["device_code"] = data.DeviceCode!; - - using var content = new FormUrlEncodedContent(extData); - using var response = await HttpRequest - .CreatePost(options.Meta.TokenEndpoint) - .WithContent(content) - .WithHeaders(options.Headers ?? []) - .SendAsync(client, cancellationToken: token) - .ConfigureAwait(false); - - return await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 刷新登录 - /// - /// - /// - /// - /// - /// - public async Task AuthorizeWithSilentAsync - (AuthorizeResult data,CancellationToken token,Dictionary? extData = null) - { - var client = options.GetClient.Invoke(); - if (data.IsError) throw new OperationCanceledException(data.ErrorDescription); - extData ??= []; - extData["refresh_token"] = data.RefreshToken!; - extData["grant_type"] = "refresh_token"; - extData["client_id"] = options.ClientId; - using var content = new FormUrlEncodedContent(extData); - using var response = await HttpRequest - .CreatePost(options.Meta.TokenEndpoint) - .WithHeaders(options.Headers ?? []) - .WithContent(content) - .SendAsync(client, cancellationToken: token) - .ConfigureAwait(false); - - return await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } +using System; +using System.Text; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading; +using PCL.CE.Core.IO.Net.Http.Client.Request; + +namespace PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +/// +/// OAuth 客户端实现,配合 Polly 食用效果更佳 +/// +/// OAuth 参数 +public sealed class SimpleOAuthClient(OAuthClientOptions options):IOAuthClient +{ + /// + /// 获取授权 Url + /// + /// 访问权限列表 + /// + /// + /// + public string GetAuthorizeUrl(string[] scopes,string state,Dictionary? extData = null) + { + ArgumentException.ThrowIfNullOrWhiteSpace(options.Meta.AuthorizeEndpoint); + var sb = new StringBuilder(); + sb.Append(options.Meta.AuthorizeEndpoint); + sb.Append($"?response_type=code&scope={Uri.EscapeDataString(string.Join(" ", scopes))}"); + sb.Append($"&redirect_uri={Uri.EscapeDataString(options.RedirectUri)}"); + sb.Append($"&client_id={options.ClientId}&state={state}"); + if (extData is null) return sb.ToString(); + foreach (var kvp in extData) + sb.Append($"&{kvp.Key}={Uri.EscapeDataString(kvp.Value)}"); + return sb.ToString(); + } + + /// + /// 使用授权代码获取令牌 + /// + /// 授权代码 + /// 附加属性,不应该包含必须参数和预定义字段 (e.g. client_id、grant_type) + /// + /// + public async Task AuthorizeWithCodeAsync( + string code,CancellationToken token,Dictionary? extData = null + ) + { + extData ??= new Dictionary(); + extData["client_id"] = options.ClientId; + extData["grant_type"] = "authorization_code"; + extData["code"] = code; + var client = options.GetClient.Invoke(); + using var content = new FormUrlEncodedContent(extData); + using var response = await HttpRequest + .CreatePost(options.Meta.TokenEndpoint) + .WithContent(content) + .WithHeaders(options.Headers ?? []) + .SendAsync(client, cancellationToken: token) + .ConfigureAwait(false); + var result = await response.Content.ReadAsStringAsync(token); + return await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 获取设备代码对 + /// + /// + /// + /// + /// + public async Task GetCodePairAsync + (string[] scopes,CancellationToken token, Dictionary? extData = null) + { + ArgumentException.ThrowIfNullOrEmpty(options.Meta.DeviceEndpoint); + var client = options.GetClient.Invoke(); + extData ??= new Dictionary(); + extData["scope"] = string.Join(" ", scopes); + extData["client_id"] = options.ClientId; + var content = new FormUrlEncodedContent(extData); + + using var response = await HttpRequest + .CreatePost(options.Meta.DeviceEndpoint) + .WithContent(content) + .WithHeaders(options.Headers ?? []) + .SendAsync(client, cancellationToken: token) + .ConfigureAwait(false); + + return await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 验证用户授权状态
+ /// 注:此方法不会检查是否过去了 Interval 秒,请自行处理 + ///
+ /// + /// + /// + /// + /// + public async Task AuthorizeWithDeviceAsync + (DeviceCodeData data,CancellationToken token,Dictionary? extData = null) + { + if (data.IsError) throw new OperationCanceledException(data.ErrorDescription); + var client = options.GetClient.Invoke(); + extData ??= new Dictionary(); + extData["client_id"] = options.ClientId; + extData["grant_type"] = "urn:ietf:params:oauth:grant-type:device_code"; + extData["device_code"] = data.DeviceCode!; + + using var content = new FormUrlEncodedContent(extData); + using var response = await HttpRequest + .CreatePost(options.Meta.TokenEndpoint) + .WithContent(content) + .WithHeaders(options.Headers ?? []) + .SendAsync(client, cancellationToken: token) + .ConfigureAwait(false); + + return await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 刷新登录 + /// + /// + /// + /// + /// + /// + public async Task AuthorizeWithSilentAsync + (AuthorizeResult data,CancellationToken token,Dictionary? extData = null) + { + var client = options.GetClient.Invoke(); + if (data.IsError) throw new OperationCanceledException(data.ErrorDescription); + extData ??= []; + extData["refresh_token"] = data.RefreshToken!; + extData["grant_type"] = "refresh_token"; + extData["client_id"] = options.ClientId; + using var content = new FormUrlEncodedContent(extData); + using var response = await HttpRequest + .CreatePost(options.Meta.TokenEndpoint) + .WithHeaders(options.Headers ?? []) + .WithContent(content) + .SendAsync(client, cancellationToken: token) + .ConfigureAwait(false); + + return await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/OAuth/ClientOptions.cs b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/ClientOptions.cs similarity index 89% rename from PCL.Core/Minecraft/IdentityModel/OAuth/ClientOptions.cs rename to PCL.CE/Core/Minecraft/IdentityModel/OAuth/ClientOptions.cs index 24835ee20..0e19b5f30 100644 --- a/PCL.Core/Minecraft/IdentityModel/OAuth/ClientOptions.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/ClientOptions.cs @@ -1,26 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; - -namespace PCL.Core.Minecraft.IdentityModel.OAuth; - -public record OAuthClientOptions -{ - /// - /// 请求头 - /// - public Dictionary? Headers { get; set; } - /// - /// 端点数据 - /// - public required EndpointMeta Meta { get; set; } - public required Func GetClient { get; set; } - /// - /// 重定向 Uri - /// - public required string RedirectUri { get; set; } - /// - /// 客户端 ID - /// - public required string ClientId { get; set; } +using System; +using System.Collections.Generic; +using System.Net.Http; + +namespace PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +public record OAuthClientOptions +{ + /// + /// 请求头 + /// + public Dictionary? Headers { get; set; } + /// + /// 端点数据 + /// + public required EndpointMeta Meta { get; set; } + public required Func GetClient { get; set; } + /// + /// 重定向 Uri + /// + public required string RedirectUri { get; set; } + /// + /// 客户端 ID + /// + public required string ClientId { get; set; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/OAuth/DeviceCodeData.cs b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/DeviceCodeData.cs similarity index 91% rename from PCL.Core/Minecraft/IdentityModel/OAuth/DeviceCodeData.cs rename to PCL.CE/Core/Minecraft/IdentityModel/OAuth/DeviceCodeData.cs index 0dd8b2f22..21e1c4952 100644 --- a/PCL.Core/Minecraft/IdentityModel/OAuth/DeviceCodeData.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/DeviceCodeData.cs @@ -1,49 +1,49 @@ -using System.Text.Json.Serialization; -using PCL.Core.Utils.Exts; - -namespace PCL.Core.Minecraft.IdentityModel.OAuth; - -public record DeviceCodeData -{ - public bool IsError => !Error.IsNullOrEmpty(); - /// - /// 错误类型 - /// - [JsonPropertyName("error")] - public string? Error { get; init; } - /// - /// 错误描述 - /// - [JsonPropertyName("error_description")] - public string? ErrorDescription { get; init; } - /// - /// 用户授权码 - /// - [JsonPropertyName("user_code")] - public string? UserCode { get; init; } - /// - /// 设备授权码 - /// - [JsonPropertyName("device_code")] - public string? DeviceCode { get; init; } - /// - /// 验证 Uri - /// - [JsonPropertyName("verification_uri")] - public string? VerificationUri { get; init; } - /// - /// 验证 Uri (自动填充代码) - /// - [JsonPropertyName("verification_uri_complete")] - public string? VerificationUriComplete { get; init; } - /// - /// 轮询间隔 - /// - [JsonPropertyName("interval")] - public int? Interval { get; init; } - /// - /// 过期时间 - /// - [JsonPropertyName("expires_in")] - public int? ExpiresIn { get; init; } +using System.Text.Json.Serialization; +using PCL.CE.Core.Utils.Exts; + +namespace PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +public record DeviceCodeData +{ + public bool IsError => !Error.IsNullOrEmpty(); + /// + /// 错误类型 + /// + [JsonPropertyName("error")] + public string? Error { get; init; } + /// + /// 错误描述 + /// + [JsonPropertyName("error_description")] + public string? ErrorDescription { get; init; } + /// + /// 用户授权码 + /// + [JsonPropertyName("user_code")] + public string? UserCode { get; init; } + /// + /// 设备授权码 + /// + [JsonPropertyName("device_code")] + public string? DeviceCode { get; init; } + /// + /// 验证 Uri + /// + [JsonPropertyName("verification_uri")] + public string? VerificationUri { get; init; } + /// + /// 验证 Uri (自动填充代码) + /// + [JsonPropertyName("verification_uri_complete")] + public string? VerificationUriComplete { get; init; } + /// + /// 轮询间隔 + /// + [JsonPropertyName("interval")] + public int? Interval { get; init; } + /// + /// 过期时间 + /// + [JsonPropertyName("expires_in")] + public int? ExpiresIn { get; init; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/OAuth/EndpointMeta.cs b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/EndpointMeta.cs similarity index 84% rename from PCL.Core/Minecraft/IdentityModel/OAuth/EndpointMeta.cs rename to PCL.CE/Core/Minecraft/IdentityModel/OAuth/EndpointMeta.cs index c26c9ec8a..9268b17b2 100644 --- a/PCL.Core/Minecraft/IdentityModel/OAuth/EndpointMeta.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/EndpointMeta.cs @@ -1,17 +1,17 @@ -namespace PCL.Core.Minecraft.IdentityModel.OAuth; - -public record EndpointMeta -{ - /// - /// 设备授权端点 - /// - public string? DeviceEndpoint { get; set; } - /// - /// 授权端点 - /// - public required string AuthorizeEndpoint { get; set; } - /// - /// 令牌端点 - /// - public required string TokenEndpoint { get; set; } +namespace PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +public record EndpointMeta +{ + /// + /// 设备授权端点 + /// + public string? DeviceEndpoint { get; set; } + /// + /// 授权端点 + /// + public required string AuthorizeEndpoint { get; set; } + /// + /// 令牌端点 + /// + public required string TokenEndpoint { get; set; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/OAuth/IOAuthClient.cs b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/IOAuthClient.cs similarity index 92% rename from PCL.Core/Minecraft/IdentityModel/OAuth/IOAuthClient.cs rename to PCL.CE/Core/Minecraft/IdentityModel/OAuth/IOAuthClient.cs index dd035367a..ee9e12c78 100644 --- a/PCL.Core/Minecraft/IdentityModel/OAuth/IOAuthClient.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/OAuth/IOAuthClient.cs @@ -1,14 +1,14 @@ -using System.Threading; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace PCL.Core.Minecraft.IdentityModel.OAuth; - -public interface IOAuthClient -{ - public string GetAuthorizeUrl(string[] scopes,string state,Dictionary? extData); - public Task AuthorizeWithCodeAsync(string code,CancellationToken token,Dictionary? extData = null); - public Task GetCodePairAsync(string[] scopes,CancellationToken token, Dictionary? extData = null); - public Task AuthorizeWithDeviceAsync(DeviceCodeData data,CancellationToken token,Dictionary? extData = null); - public Task AuthorizeWithSilentAsync(AuthorizeResult data,CancellationToken token,Dictionary? extData = null); +using System.Threading; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace PCL.CE.Core.Minecraft.IdentityModel.OAuth; + +public interface IOAuthClient +{ + public string GetAuthorizeUrl(string[] scopes,string state,Dictionary? extData); + public Task AuthorizeWithCodeAsync(string code,CancellationToken token,Dictionary? extData = null); + public Task GetCodePairAsync(string[] scopes,CancellationToken token, Dictionary? extData = null); + public Task AuthorizeWithDeviceAsync(DeviceCodeData data,CancellationToken token,Dictionary? extData = null); + public Task AuthorizeWithSilentAsync(AuthorizeResult data,CancellationToken token,Dictionary? extData = null); } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Agent.cs b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Agent.cs similarity index 80% rename from PCL.Core/Minecraft/IdentityModel/Yggdrasil/Agent.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Agent.cs index c27dadfed..31218158b 100644 --- a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Agent.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Agent.cs @@ -1,12 +1,12 @@ -using System.Text.Json.Serialization; - -namespace PCL.Core.Minecraft.IdentityModel.Yggdrasil; - -/// -/// Yggdrasil Agent -/// -public record Agent -{ - [JsonPropertyName("name")] public string Name { get; init; } = "minecraft"; - [JsonPropertyName("version")] public int Version { get; init; } = 1; +using System.Text.Json.Serialization; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Yggdrasil; + +/// +/// Yggdrasil Agent +/// +public record Agent +{ + [JsonPropertyName("name")] public string Name { get; init; } = "minecraft"; + [JsonPropertyName("version")] public int Version { get; init; } = 1; } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Client.cs b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Client.cs similarity index 95% rename from PCL.Core/Minecraft/IdentityModel/Yggdrasil/Client.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Client.cs index e05711946..7117fa460 100644 --- a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Client.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Client.cs @@ -1,145 +1,145 @@ -using PCL.Core.IO.Net.Http.Client.Request; -using System; -using System.Net; -using System.Text.Json.Nodes; -using System.Threading; -using System.Threading.Tasks; - -namespace PCL.Core.Minecraft.IdentityModel.Yggdrasil; - -/// -/// 提供 Yggdrasil 传统认证支持 -/// -/// 认证参数 -public sealed class YggdrasilLegacyClient(YggdrasilLegacyAuthenticateOptions options) -{ - /// - /// 异步向服务器发送一次登录请求 - /// - /// - /// 认证结果 - /// 用户名或密码无效 - public async Task AuthenticateAsync(CancellationToken token) - { - ArgumentException.ThrowIfNullOrEmpty(options.Username); - ArgumentException.ThrowIfNullOrEmpty(options.Password); - - var credential = new YggdrasilCredential - { - User = options.Username, - Password = options.Password, - }; - var address = $"{options.YggdrasilApiLocation}/authserver/authenticate"; - - using var response = await HttpRequest - .CreatePost(address) - .WithHeaders(options.Headers ?? []) - .WithJsonContent(credential) - .SendAsync(options.GetClient.Invoke(), cancellationToken: token) - .ConfigureAwait(false); - - return await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 异步向服务器发送一次刷新请求 - /// - /// - /// 如果需要选择角色,请填写此参数 - public async Task RefreshAsync(CancellationToken token,Profile? seleectedProfile) - { - ArgumentException.ThrowIfNullOrEmpty(options.AccessToken); - - var refreshData = new YggdrasilRefresh() - { - AccessToken = options.AccessToken - }; - if (seleectedProfile is not null) refreshData.SelectedProfile = seleectedProfile; - - var address = $"{options.YggdrasilApiLocation}/authserver/refresh"; - - using var response = await HttpRequest - .CreatePost(address) - .WithJsonContent(refreshData) - .WithHeaders(options.Headers ?? []) - .SendAsync(options.GetClient.Invoke(), cancellationToken: token) - .ConfigureAwait(false); - - return await response - .AsJsonAsync(cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 异步向服务器发送一次验证请求 - /// - /// - /// - public async Task ValidateAsync(CancellationToken token) - { - ArgumentException.ThrowIfNullOrEmpty(options.AccessToken); - - var validateData = new YggdrasilRefresh() - { - AccessToken = options.AccessToken - }; - var address = $"{options.YggdrasilApiLocation}/authserver/invalidate"; - - using var response = await HttpRequest - .CreatePost(address) - .WithHeaders(options.Headers ?? []) - .WithJsonContent(validateData) - .SendAsync(options.GetClient.Invoke(), cancellationToken: token) - .ConfigureAwait(false); - - return response.StatusCode == HttpStatusCode.NoContent; - } - - /// - /// 异步向服务器发送一次注销请求 - /// - /// - public async Task InvalidateAsync(CancellationToken token) - { - ArgumentException.ThrowIfNullOrEmpty(options.AccessToken); - - var validateData = new YggdrasilRefresh() - { - AccessToken = options.AccessToken - }; - var address = $"{options.YggdrasilApiLocation}/authserver/invalidate"; - - using var _ = await HttpRequest - .CreatePost(address) - .WithHeaders(options.Headers ?? []) - .WithJsonContent(validateData) - .SendAsync(options.GetClient.Invoke(), cancellationToken: token) - .ConfigureAwait(false); - } - /// - /// 异步向服务器发送登出请求
- /// 这会立刻注销所有会话,无论当前会话是否属于调用方 - ///
- /// - /// - public async Task<(bool IsSuccess,string ErrorDescription)> SignOutAsync(CancellationToken token) - { - // 不想写 Model 了,就这样吧(趴 - var signoutData = new JsonObject - { - ["username"] = options.Username, - ["password"] = options.Password - }; - var address = $"{options.YggdrasilApiLocation}/authserver/signout"; - - using var response = await HttpRequest - .CreatePost(address) - .WithHeaders(options.Headers ?? []) - .WithJsonContent(signoutData) - .SendAsync(options.GetClient.Invoke(), cancellationToken: token) - .ConfigureAwait(false); - - var data = JsonNode.Parse(await response.AsStringAsync(token)); - return (response.StatusCode == HttpStatusCode.NoContent, data?["errorMessage"]?.ToString()!); - } -} +using PCL.CE.Core.IO.Net.Http.Client.Request; +using System; +using System.Net; +using System.Text.Json.Nodes; +using System.Threading; +using System.Threading.Tasks; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Yggdrasil; + +/// +/// 提供 Yggdrasil 传统认证支持 +/// +/// 认证参数 +public sealed class YggdrasilLegacyClient(YggdrasilLegacyAuthenticateOptions options) +{ + /// + /// 异步向服务器发送一次登录请求 + /// + /// + /// 认证结果 + /// 用户名或密码无效 + public async Task AuthenticateAsync(CancellationToken token) + { + ArgumentException.ThrowIfNullOrEmpty(options.Username); + ArgumentException.ThrowIfNullOrEmpty(options.Password); + + var credential = new YggdrasilCredential + { + User = options.Username, + Password = options.Password, + }; + var address = $"{options.YggdrasilApiLocation}/authserver/authenticate"; + + using var response = await HttpRequest + .CreatePost(address) + .WithHeaders(options.Headers ?? []) + .WithJsonContent(credential) + .SendAsync(options.GetClient.Invoke(), cancellationToken: token) + .ConfigureAwait(false); + + return await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 异步向服务器发送一次刷新请求 + /// + /// + /// 如果需要选择角色,请填写此参数 + public async Task RefreshAsync(CancellationToken token,Profile? seleectedProfile) + { + ArgumentException.ThrowIfNullOrEmpty(options.AccessToken); + + var refreshData = new YggdrasilRefresh() + { + AccessToken = options.AccessToken + }; + if (seleectedProfile is not null) refreshData.SelectedProfile = seleectedProfile; + + var address = $"{options.YggdrasilApiLocation}/authserver/refresh"; + + using var response = await HttpRequest + .CreatePost(address) + .WithJsonContent(refreshData) + .WithHeaders(options.Headers ?? []) + .SendAsync(options.GetClient.Invoke(), cancellationToken: token) + .ConfigureAwait(false); + + return await response + .AsJsonAsync(cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 异步向服务器发送一次验证请求 + /// + /// + /// + public async Task ValidateAsync(CancellationToken token) + { + ArgumentException.ThrowIfNullOrEmpty(options.AccessToken); + + var validateData = new YggdrasilRefresh() + { + AccessToken = options.AccessToken + }; + var address = $"{options.YggdrasilApiLocation}/authserver/invalidate"; + + using var response = await HttpRequest + .CreatePost(address) + .WithHeaders(options.Headers ?? []) + .WithJsonContent(validateData) + .SendAsync(options.GetClient.Invoke(), cancellationToken: token) + .ConfigureAwait(false); + + return response.StatusCode == HttpStatusCode.NoContent; + } + + /// + /// 异步向服务器发送一次注销请求 + /// + /// + public async Task InvalidateAsync(CancellationToken token) + { + ArgumentException.ThrowIfNullOrEmpty(options.AccessToken); + + var validateData = new YggdrasilRefresh() + { + AccessToken = options.AccessToken + }; + var address = $"{options.YggdrasilApiLocation}/authserver/invalidate"; + + using var _ = await HttpRequest + .CreatePost(address) + .WithHeaders(options.Headers ?? []) + .WithJsonContent(validateData) + .SendAsync(options.GetClient.Invoke(), cancellationToken: token) + .ConfigureAwait(false); + } + /// + /// 异步向服务器发送登出请求
+ /// 这会立刻注销所有会话,无论当前会话是否属于调用方 + ///
+ /// + /// + public async Task<(bool IsSuccess,string ErrorDescription)> SignOutAsync(CancellationToken token) + { + // 不想写 Model 了,就这样吧(趴 + var signoutData = new JsonObject + { + ["username"] = options.Username, + ["password"] = options.Password + }; + var address = $"{options.YggdrasilApiLocation}/authserver/signout"; + + using var response = await HttpRequest + .CreatePost(address) + .WithHeaders(options.Headers ?? []) + .WithJsonContent(signoutData) + .SendAsync(options.GetClient.Invoke(), cancellationToken: token) + .ConfigureAwait(false); + + var data = JsonNode.Parse(await response.AsStringAsync(token)); + return (response.StatusCode == HttpStatusCode.NoContent, data?["errorMessage"]?.ToString()!); + } +} diff --git a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Options.cs b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Options.cs similarity index 90% rename from PCL.Core/Minecraft/IdentityModel/Yggdrasil/Options.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Options.cs index 90581a8c9..edba8f3db 100644 --- a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Options.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Options.cs @@ -1,30 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; - -namespace PCL.Core.Minecraft.IdentityModel.Yggdrasil; - -public record YggdrasilLegacyAuthenticateOptions -{ - /// - /// API 基地址 (e.g. https://api.example.com/api/yggdrasil) - /// - public required string YggdrasilApiLocation { get; set; } - /// - /// 用户名 - /// - public string? Username { get; set; } - /// - /// 密码 - /// - public string? Password { get; set; } - /// - /// 访问令牌 - /// - public string? AccessToken { get; set; } - public required Func GetClient { get; set; } - /// - /// 请求头 - /// - public Dictionary? Headers { get; set; } -} +using System; +using System.Collections.Generic; +using System.Net.Http; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Yggdrasil; + +public record YggdrasilLegacyAuthenticateOptions +{ + /// + /// API 基地址 (e.g. https://api.example.com/api/yggdrasil) + /// + public required string YggdrasilApiLocation { get; set; } + /// + /// 用户名 + /// + public string? Username { get; set; } + /// + /// 密码 + /// + public string? Password { get; set; } + /// + /// 访问令牌 + /// + public string? AccessToken { get; set; } + public required Func GetClient { get; set; } + /// + /// 请求头 + /// + public Dictionary? Headers { get; set; } +} diff --git a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Profile.cs b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Profile.cs similarity index 94% rename from PCL.Core/Minecraft/IdentityModel/Yggdrasil/Profile.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Profile.cs index fe580ac96..6332058c1 100644 --- a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/Profile.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/Profile.cs @@ -1,88 +1,88 @@ -using System.Text.Json.Serialization; - -namespace PCL.Core.Minecraft.IdentityModel.Yggdrasil; - - -public record Profile -{ - /// - /// UUID - /// - [JsonPropertyName("id")] public required string Id { get; init; } - /// - /// 档案名称 - /// - [JsonPropertyName("name")] public string? Name { get; init; } - /// - /// 属性信息 - /// - [JsonPropertyName("properties")] public PlayerProperty[]? Properties { get; init; } -} - -public record PlayerProperty -{ - /// - /// 属性名称 - /// - [JsonPropertyName("name")] public required string Name { get; init; } - /// - /// 属性值 - /// - [JsonPropertyName("value")] public required string Value { get; init; } - /// - /// 数字签名 - /// - [JsonPropertyName("signature")] public string? Signature { get; init; } -} - -public record PlayerTextureProperty -{ - /// - /// Unix 时间戳 - /// - [JsonPropertyName("timestamp")] public required long Timestamp { get; init; } - /// - /// 所有者的 UUID - /// - [JsonPropertyName("profileId")] public required string ProfileId { get; init; } - /// - /// 所有者名称 - /// - [JsonPropertyName("profileName")] public required string ProfileName { get; init; } - /// - /// 材质信息 - /// - [JsonPropertyName("textures")] public required PlayerTextures Textures { get; init; } -} - -public record PlayerTextures -{ - /// - /// 皮肤 - /// - [JsonPropertyName("skin")] public required PlayerTexture Skin { get; init; } - /// - /// 披风 - /// - [JsonPropertyName("cape")] public required PlayerTexture Cape { get; init; } -} - -public record PlayerTexture -{ - /// - /// 材质地址 - /// - [JsonPropertyName("Url")] public required string Url { get; init; } - /// - /// 元数据 - /// - [JsonPropertyName("metadata")] public required PlayerTextureMetadata Metadata { get; init; } -} - -public record PlayerTextureMetadata -{ - /// - /// 模型信息 (e.g. Steven -> default, Alex -> Slim) - /// - [JsonPropertyName("model")] public required string Model { get; init; } +using System.Text.Json.Serialization; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Yggdrasil; + + +public record Profile +{ + /// + /// UUID + /// + [JsonPropertyName("id")] public required string Id { get; init; } + /// + /// 档案名称 + /// + [JsonPropertyName("name")] public string? Name { get; init; } + /// + /// 属性信息 + /// + [JsonPropertyName("properties")] public PlayerProperty[]? Properties { get; init; } +} + +public record PlayerProperty +{ + /// + /// 属性名称 + /// + [JsonPropertyName("name")] public required string Name { get; init; } + /// + /// 属性值 + /// + [JsonPropertyName("value")] public required string Value { get; init; } + /// + /// 数字签名 + /// + [JsonPropertyName("signature")] public string? Signature { get; init; } +} + +public record PlayerTextureProperty +{ + /// + /// Unix 时间戳 + /// + [JsonPropertyName("timestamp")] public required long Timestamp { get; init; } + /// + /// 所有者的 UUID + /// + [JsonPropertyName("profileId")] public required string ProfileId { get; init; } + /// + /// 所有者名称 + /// + [JsonPropertyName("profileName")] public required string ProfileName { get; init; } + /// + /// 材质信息 + /// + [JsonPropertyName("textures")] public required PlayerTextures Textures { get; init; } +} + +public record PlayerTextures +{ + /// + /// 皮肤 + /// + [JsonPropertyName("skin")] public required PlayerTexture Skin { get; init; } + /// + /// 披风 + /// + [JsonPropertyName("cape")] public required PlayerTexture Cape { get; init; } +} + +public record PlayerTexture +{ + /// + /// 材质地址 + /// + [JsonPropertyName("Url")] public required string Url { get; init; } + /// + /// 元数据 + /// + [JsonPropertyName("metadata")] public required PlayerTextureMetadata Metadata { get; init; } +} + +public record PlayerTextureMetadata +{ + /// + /// 模型信息 (e.g. Steven -> default, Alex -> Slim) + /// + [JsonPropertyName("model")] public required string Model { get; init; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/YggdrasilCredential.cs b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/YggdrasilCredential.cs similarity index 94% rename from PCL.Core/Minecraft/IdentityModel/Yggdrasil/YggdrasilCredential.cs rename to PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/YggdrasilCredential.cs index 1bfd51ff7..a772ee212 100644 --- a/PCL.Core/Minecraft/IdentityModel/Yggdrasil/YggdrasilCredential.cs +++ b/PCL.CE/Core/Minecraft/IdentityModel/Yggdrasil/YggdrasilCredential.cs @@ -1,49 +1,49 @@ -using System.Text.Json.Serialization; - -namespace PCL.Core.Minecraft.IdentityModel.Yggdrasil; - -public record YggdrasilCredential -{ - [JsonPropertyName("username")] public required string User { get; init; } - [JsonPropertyName("password")] public required string Password { get; init; } - [JsonPropertyName("agent")] public Agent Agent = new(); - [JsonPropertyName("requestUser")] public bool RequestUser { get; set; } -} - -public record YggdrasilAuthenticateResult -{ - /// - /// 错误类型 - /// - [JsonPropertyName("error")] public string? Error { get; init; } - /// - /// 错误消息 - /// - [JsonPropertyName("errorMessage")] public string? ErrorMessage { get; init; } - /// - /// 访问令牌 - /// - [JsonPropertyName("accessToken")] public string? AccessToken { get; init; } - /// - /// 客户端令牌,基本没用 - /// - [JsonPropertyName("clientToken")] public string? ClientToken { get; init; } - /// - /// 选择的档案 - /// - [JsonPropertyName("selectedProfile")] public Profile? SelectedProfile { get; init; } - /// - /// 可用档案 - /// - [JsonPropertyName("availableProfiles")] public required Profile[]? AvailableProfiles { get; init; } - /// - /// 用户信息 - /// - [JsonPropertyName("user")] public Profile? User; -} - -public record YggdrasilRefresh -{ - [JsonPropertyName("accessToken")] public required string AccessToken { get; set; } - [JsonPropertyName("selectedProfile")] public Profile? SelectedProfile { get; set; } +using System.Text.Json.Serialization; + +namespace PCL.CE.Core.Minecraft.IdentityModel.Yggdrasil; + +public record YggdrasilCredential +{ + [JsonPropertyName("username")] public required string User { get; init; } + [JsonPropertyName("password")] public required string Password { get; init; } + [JsonPropertyName("agent")] public Agent Agent = new(); + [JsonPropertyName("requestUser")] public bool RequestUser { get; set; } +} + +public record YggdrasilAuthenticateResult +{ + /// + /// 错误类型 + /// + [JsonPropertyName("error")] public string? Error { get; init; } + /// + /// 错误消息 + /// + [JsonPropertyName("errorMessage")] public string? ErrorMessage { get; init; } + /// + /// 访问令牌 + /// + [JsonPropertyName("accessToken")] public string? AccessToken { get; init; } + /// + /// 客户端令牌,基本没用 + /// + [JsonPropertyName("clientToken")] public string? ClientToken { get; init; } + /// + /// 选择的档案 + /// + [JsonPropertyName("selectedProfile")] public Profile? SelectedProfile { get; init; } + /// + /// 可用档案 + /// + [JsonPropertyName("availableProfiles")] public required Profile[]? AvailableProfiles { get; init; } + /// + /// 用户信息 + /// + [JsonPropertyName("user")] public Profile? User; +} + +public record YggdrasilRefresh +{ + [JsonPropertyName("accessToken")] public required string AccessToken { get; set; } + [JsonPropertyName("selectedProfile")] public Profile? SelectedProfile { get; set; } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/Java/JavaBrandType.cs b/PCL.CE/Core/Minecraft/Java/JavaBrandType.cs similarity index 84% rename from PCL.Core/Minecraft/Java/JavaBrandType.cs rename to PCL.CE/Core/Minecraft/Java/JavaBrandType.cs index 251d9c124..da532eed7 100644 --- a/PCL.Core/Minecraft/Java/JavaBrandType.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaBrandType.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Minecraft.Java; +namespace PCL.CE.Core.Minecraft.Java; public enum JavaBrandType { diff --git a/PCL.Core/Minecraft/Java/JavaConsts.cs b/PCL.CE/Core/Minecraft/Java/JavaConsts.cs similarity index 95% rename from PCL.Core/Minecraft/Java/JavaConsts.cs rename to PCL.CE/Core/Minecraft/Java/JavaConsts.cs index 07e7b96eb..f1c114667 100644 --- a/PCL.Core/Minecraft/Java/JavaConsts.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaConsts.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace PCL.Core.Minecraft.Java; +namespace PCL.CE.Core.Minecraft.Java; public class JavaConsts { public static readonly string[] ExcludeFolderNames = ["javapath", "java8path", "common files", "netease"]; diff --git a/PCL.Core/Minecraft/Java/JavaEntry.cs b/PCL.CE/Core/Minecraft/Java/JavaEntry.cs similarity index 81% rename from PCL.Core/Minecraft/Java/JavaEntry.cs rename to PCL.CE/Core/Minecraft/Java/JavaEntry.cs index eb7e44864..7a89752b6 100644 --- a/PCL.Core/Minecraft/Java/JavaEntry.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaEntry.cs @@ -1,6 +1,6 @@ -using PCL.Core.Minecraft.Java; +using PCL.CE.Core.Minecraft.Java; -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; public sealed class JavaEntry { diff --git a/PCL.Core/Minecraft/Java/JavaInstallation.cs b/PCL.CE/Core/Minecraft/Java/JavaInstallation.cs similarity index 94% rename from PCL.Core/Minecraft/Java/JavaInstallation.cs rename to PCL.CE/Core/Minecraft/Java/JavaInstallation.cs index 03367a7c6..abf7a62d9 100644 --- a/PCL.Core/Minecraft/Java/JavaInstallation.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaInstallation.cs @@ -1,4 +1,4 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; using System; using System.Collections.Generic; using System.IO; @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; -namespace PCL.Core.Minecraft.Java; +namespace PCL.CE.Core.Minecraft.Java; public sealed record JavaInstallation( string JavaFolder, diff --git a/PCL.Core/Minecraft/Java/JavaManager.cs b/PCL.CE/Core/Minecraft/Java/JavaManager.cs similarity index 97% rename from PCL.Core/Minecraft/Java/JavaManager.cs rename to PCL.CE/Core/Minecraft/Java/JavaManager.cs index f0826af0a..911999acd 100644 --- a/PCL.Core/Minecraft/Java/JavaManager.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaManager.cs @@ -1,9 +1,9 @@ -using PCL.Core.Logging; -using PCL.Core.Minecraft.Java; -using PCL.Core.Minecraft.Java.Parser; -using PCL.Core.Minecraft.Java.Scanner; -using PCL.Core.App; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Minecraft.Java; +using PCL.CE.Core.Minecraft.Java.Parser; +using PCL.CE.Core.Minecraft.Java.Scanner; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils.Exts; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -13,7 +13,7 @@ using System.Threading.Tasks; using System.Text.Json; -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; public class JavaManager { diff --git a/PCL.Core/Minecraft/Java/JavaService.cs b/PCL.CE/Core/Minecraft/Java/JavaService.cs similarity index 87% rename from PCL.Core/Minecraft/Java/JavaService.cs rename to PCL.CE/Core/Minecraft/Java/JavaService.cs index c40627d7d..8cf4a2e3a 100644 --- a/PCL.Core/Minecraft/Java/JavaService.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaService.cs @@ -1,10 +1,10 @@ -using PCL.Core.App; -using PCL.Core.Minecraft.Java.Parser; -using PCL.Core.Minecraft.Java.Scanner; +using PCL.CE.Core.App; +using PCL.CE.Core.Minecraft.Java.Parser; +using PCL.CE.Core.Minecraft.Java.Scanner; using System.Threading.Tasks; -using PCL.Core.App.IoC; +using PCL.CE.Core.App.IoC; -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; [LifecycleService(LifecycleState.Loaded)] [LifecycleScope("java", "Java 管理")] diff --git a/PCL.Core/Minecraft/Java/JavaSource.cs b/PCL.CE/Core/Minecraft/Java/JavaSource.cs similarity index 84% rename from PCL.Core/Minecraft/Java/JavaSource.cs rename to PCL.CE/Core/Minecraft/Java/JavaSource.cs index f6c7b51ff..f03ccc021 100644 --- a/PCL.Core/Minecraft/Java/JavaSource.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaSource.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace PCL.Core.Minecraft.Java; +namespace PCL.CE.Core.Minecraft.Java; public enum JavaSource { AutoScanned, diff --git a/PCL.Core/Minecraft/Java/JavaStorageItem.cs b/PCL.CE/Core/Minecraft/Java/JavaStorageItem.cs similarity index 88% rename from PCL.Core/Minecraft/Java/JavaStorageItem.cs rename to PCL.CE/Core/Minecraft/Java/JavaStorageItem.cs index 5d4af16a4..3bc513e02 100644 --- a/PCL.Core/Minecraft/Java/JavaStorageItem.cs +++ b/PCL.CE/Core/Minecraft/Java/JavaStorageItem.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace PCL.Core.Minecraft.Java; +namespace PCL.CE.Core.Minecraft.Java; public class JavaStorageItem { diff --git a/PCL.Core/Minecraft/Java/Parser/IJavaParser.cs b/PCL.CE/Core/Minecraft/Java/Parser/IJavaParser.cs similarity index 63% rename from PCL.Core/Minecraft/Java/Parser/IJavaParser.cs rename to PCL.CE/Core/Minecraft/Java/Parser/IJavaParser.cs index a0ac4a3b7..439a02773 100644 --- a/PCL.Core/Minecraft/Java/Parser/IJavaParser.cs +++ b/PCL.CE/Core/Minecraft/Java/Parser/IJavaParser.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Minecraft.Java.Parser; +namespace PCL.CE.Core.Minecraft.Java.Parser; public interface IJavaParser { JavaInstallation? Parse(string javaExePath); diff --git a/PCL.Core/Minecraft/Java/Parser/PeHeaderParser.cs b/PCL.CE/Core/Minecraft/Java/Parser/PeHeaderParser.cs similarity index 97% rename from PCL.Core/Minecraft/Java/Parser/PeHeaderParser.cs rename to PCL.CE/Core/Minecraft/Java/Parser/PeHeaderParser.cs index 0b08a9f5f..cc43e7264 100644 --- a/PCL.Core/Minecraft/Java/Parser/PeHeaderParser.cs +++ b/PCL.CE/Core/Minecraft/Java/Parser/PeHeaderParser.cs @@ -1,12 +1,12 @@ -using PCL.Core.Logging; -using PCL.Core.Utils; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -namespace PCL.Core.Minecraft.Java.Parser; +namespace PCL.CE.Core.Minecraft.Java.Parser; public class PeHeaderParser : IJavaParser { private static readonly Dictionary _BrandMap = new() diff --git a/PCL.Core/Minecraft/Java/Scanner/DefaultPathsScanner.cs b/PCL.CE/Core/Minecraft/Java/Scanner/DefaultPathsScanner.cs similarity index 97% rename from PCL.Core/Minecraft/Java/Scanner/DefaultPathsScanner.cs rename to PCL.CE/Core/Minecraft/Java/Scanner/DefaultPathsScanner.cs index 002a8b9c2..36ecee50e 100644 --- a/PCL.Core/Minecraft/Java/Scanner/DefaultPathsScanner.cs +++ b/PCL.CE/Core/Minecraft/Java/Scanner/DefaultPathsScanner.cs @@ -1,12 +1,12 @@ -using PCL.Core.App; -using PCL.Core.Logging; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; -namespace PCL.Core.Minecraft.Java.Scanner; +namespace PCL.CE.Core.Minecraft.Java.Scanner; public class DefaultPathsScanner : IJavaScanner { diff --git a/PCL.Core/Minecraft/Java/Scanner/IJavaScanner.cs b/PCL.CE/Core/Minecraft/Java/Scanner/IJavaScanner.cs similarity index 81% rename from PCL.Core/Minecraft/Java/Scanner/IJavaScanner.cs rename to PCL.CE/Core/Minecraft/Java/Scanner/IJavaScanner.cs index 508f6c447..9abc61c93 100644 --- a/PCL.Core/Minecraft/Java/Scanner/IJavaScanner.cs +++ b/PCL.CE/Core/Minecraft/Java/Scanner/IJavaScanner.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace PCL.Core.Minecraft.Java.Scanner; +namespace PCL.CE.Core.Minecraft.Java.Scanner; public interface IJavaScanner { void Scan(ICollection results); diff --git a/PCL.Core/Minecraft/Java/Scanner/MicrosoftStoreJavaScanner.cs b/PCL.CE/Core/Minecraft/Java/Scanner/MicrosoftStoreJavaScanner.cs similarity index 95% rename from PCL.Core/Minecraft/Java/Scanner/MicrosoftStoreJavaScanner.cs rename to PCL.CE/Core/Minecraft/Java/Scanner/MicrosoftStoreJavaScanner.cs index c8bf48547..39d52e465 100644 --- a/PCL.Core/Minecraft/Java/Scanner/MicrosoftStoreJavaScanner.cs +++ b/PCL.CE/Core/Minecraft/Java/Scanner/MicrosoftStoreJavaScanner.cs @@ -1,9 +1,9 @@ -using PCL.Core.Logging; +using PCL.CE.Core.Logging; using System; using System.Collections.Generic; using System.IO; -namespace PCL.Core.Minecraft.Java.Scanner; +namespace PCL.CE.Core.Minecraft.Java.Scanner; public class MicrosoftStoreJavaScanner : IJavaScanner { private const string StorePackagePath = diff --git a/PCL.Core/Minecraft/Java/Scanner/PathEnvironmentScanner.cs b/PCL.CE/Core/Minecraft/Java/Scanner/PathEnvironmentScanner.cs similarity index 90% rename from PCL.Core/Minecraft/Java/Scanner/PathEnvironmentScanner.cs rename to PCL.CE/Core/Minecraft/Java/Scanner/PathEnvironmentScanner.cs index 8c59818dd..74fec34ed 100644 --- a/PCL.Core/Minecraft/Java/Scanner/PathEnvironmentScanner.cs +++ b/PCL.CE/Core/Minecraft/Java/Scanner/PathEnvironmentScanner.cs @@ -1,9 +1,9 @@ -using PCL.Core.Logging; +using PCL.CE.Core.Logging; using System; using System.Collections.Generic; using System.IO; -namespace PCL.Core.Minecraft.Java.Scanner; +namespace PCL.CE.Core.Minecraft.Java.Scanner; public class PathEnvironmentScanner : IJavaScanner { diff --git a/PCL.Core/Minecraft/Java/Scanner/RegistryJavaScanner.cs b/PCL.CE/Core/Minecraft/Java/Scanner/RegistryJavaScanner.cs similarity index 97% rename from PCL.Core/Minecraft/Java/Scanner/RegistryJavaScanner.cs rename to PCL.CE/Core/Minecraft/Java/Scanner/RegistryJavaScanner.cs index 076b36f8d..5d68a4fba 100644 --- a/PCL.Core/Minecraft/Java/Scanner/RegistryJavaScanner.cs +++ b/PCL.CE/Core/Minecraft/Java/Scanner/RegistryJavaScanner.cs @@ -1,11 +1,11 @@ using Microsoft.Win32; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; using System; using System.Collections.Generic; using System.IO; using System.Linq; -namespace PCL.Core.Minecraft.Java.Scanner; +namespace PCL.CE.Core.Minecraft.Java.Scanner; public class RegistryJavaScanner : IJavaScanner { diff --git a/PCL.Core/Minecraft/Java/Scanner/WhereCommandScanner.cs b/PCL.CE/Core/Minecraft/Java/Scanner/WhereCommandScanner.cs similarity index 94% rename from PCL.Core/Minecraft/Java/Scanner/WhereCommandScanner.cs rename to PCL.CE/Core/Minecraft/Java/Scanner/WhereCommandScanner.cs index d0d153873..3784ebe3a 100644 --- a/PCL.Core/Minecraft/Java/Scanner/WhereCommandScanner.cs +++ b/PCL.CE/Core/Minecraft/Java/Scanner/WhereCommandScanner.cs @@ -1,11 +1,11 @@ -using PCL.Core.Logging; +using PCL.CE.Core.Logging; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -namespace PCL.Core.Minecraft.Java.Scanner; +namespace PCL.CE.Core.Minecraft.Java.Scanner; public class WhereCommandScanner : IJavaScanner { diff --git a/PCL.CE/Core/Minecraft/Java/UserPreference/AutoSelect.cs b/PCL.CE/Core/Minecraft/Java/UserPreference/AutoSelect.cs new file mode 100644 index 000000000..bd61b9a58 --- /dev/null +++ b/PCL.CE/Core/Minecraft/Java/UserPreference/AutoSelect.cs @@ -0,0 +1,3 @@ +namespace PCL.CE.Core.Minecraft.Java.UserPreference; + +public record AutoSelect : JavaPreference; \ No newline at end of file diff --git a/PCL.Core/Minecraft/Java/UserPreference/ExistingJava.cs b/PCL.CE/Core/Minecraft/Java/UserPreference/ExistingJava.cs similarity index 53% rename from PCL.Core/Minecraft/Java/UserPreference/ExistingJava.cs rename to PCL.CE/Core/Minecraft/Java/UserPreference/ExistingJava.cs index 6189ca93c..626cafd1e 100644 --- a/PCL.Core/Minecraft/Java/UserPreference/ExistingJava.cs +++ b/PCL.CE/Core/Minecraft/Java/UserPreference/ExistingJava.cs @@ -1,3 +1,3 @@ -namespace PCL.Core.Minecraft.Java.UserPreference; +namespace PCL.CE.Core.Minecraft.Java.UserPreference; public record ExistingJava(string JavaExePath) : JavaPreference; \ No newline at end of file diff --git a/PCL.Core/Minecraft/Java/UserPreference/JavaPreference.cs b/PCL.CE/Core/Minecraft/Java/UserPreference/JavaPreference.cs similarity index 86% rename from PCL.Core/Minecraft/Java/UserPreference/JavaPreference.cs rename to PCL.CE/Core/Minecraft/Java/UserPreference/JavaPreference.cs index 048e80104..61a7164c7 100644 --- a/PCL.Core/Minecraft/Java/UserPreference/JavaPreference.cs +++ b/PCL.CE/Core/Minecraft/Java/UserPreference/JavaPreference.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Minecraft.Java.UserPreference; +namespace PCL.CE.Core.Minecraft.Java.UserPreference; [JsonPolymorphic(TypeDiscriminatorPropertyName = "kind")] [JsonDerivedType(typeof(ExistingJava), "exist")] diff --git a/PCL.CE/Core/Minecraft/Java/UserPreference/UseGlobalPreference.cs b/PCL.CE/Core/Minecraft/Java/UserPreference/UseGlobalPreference.cs new file mode 100644 index 000000000..30da1f05e --- /dev/null +++ b/PCL.CE/Core/Minecraft/Java/UserPreference/UseGlobalPreference.cs @@ -0,0 +1,3 @@ +namespace PCL.CE.Core.Minecraft.Java.UserPreference; + +public record UseGlobalPreference : JavaPreference; \ No newline at end of file diff --git a/PCL.Core/Minecraft/Java/UserPreference/UseRelativePath.cs b/PCL.CE/Core/Minecraft/Java/UserPreference/UseRelativePath.cs similarity index 55% rename from PCL.Core/Minecraft/Java/UserPreference/UseRelativePath.cs rename to PCL.CE/Core/Minecraft/Java/UserPreference/UseRelativePath.cs index 479af48a6..6aa6f4be9 100644 --- a/PCL.Core/Minecraft/Java/UserPreference/UseRelativePath.cs +++ b/PCL.CE/Core/Minecraft/Java/UserPreference/UseRelativePath.cs @@ -1,3 +1,3 @@ -namespace PCL.Core.Minecraft.Java.UserPreference; +namespace PCL.CE.Core.Minecraft.Java.UserPreference; public record UseRelativePath(string RelativePath) : JavaPreference; \ No newline at end of file diff --git a/PCL.Core/Minecraft/Launch/Utils/LaunchEnvUtils.cs b/PCL.CE/Core/Minecraft/Launch/Utils/LaunchEnvUtils.cs similarity index 96% rename from PCL.Core/Minecraft/Launch/Utils/LaunchEnvUtils.cs rename to PCL.CE/Core/Minecraft/Launch/Utils/LaunchEnvUtils.cs index 05965ec7d..d4134b59f 100644 --- a/PCL.Core/Minecraft/Launch/Utils/LaunchEnvUtils.cs +++ b/PCL.CE/Core/Minecraft/Launch/Utils/LaunchEnvUtils.cs @@ -1,9 +1,9 @@ using System; using System.IO; -using PCL.Core.App; -using PCL.Core.Logging; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; -namespace PCL.Core.Minecraft.Launch.Utils; +namespace PCL.CE.Core.Minecraft.Launch.Utils; public static class LaunchEnvUtils { private const string DebugLegacyLog4J2ConfigResource = "Resources/log4j2-legacy-debug.xml"; diff --git a/PCL.Core/Minecraft/MavenArtifact.cs b/PCL.CE/Core/Minecraft/MavenArtifact.cs similarity index 95% rename from PCL.Core/Minecraft/MavenArtifact.cs rename to PCL.CE/Core/Minecraft/MavenArtifact.cs index e3fd43800..255b687c4 100644 --- a/PCL.Core/Minecraft/MavenArtifact.cs +++ b/PCL.CE/Core/Minecraft/MavenArtifact.cs @@ -1,53 +1,53 @@ -using System; - -namespace PCL.Core.Minecraft; - -/// -/// 用于解析 Maven 包 ID 为 Uri 或 Path -/// -/// -public class MavenArtifact(string mavenId) -{ - /// - /// 将 Maven 包 ID 转换为 Uri 或 Path - /// - /// - /// - public string Resolve(string uriOrPath) - { - return $"{uriOrPath.TrimEnd('/')}{_GetMavenPath(mavenId)}"; - } - - /// - /// 解析 Maven 包 ID - /// - /// 包 ID - /// Maven 包相对路径 (以 / 开头) - /// 给定的 Maven 包 ID 长度过长或过短 - private static string _GetMavenPath(string packageId) - { - var packageIds = packageId.Split(":"); - switch (packageIds.Length) - { - case 3: - return $"/{packageIds[0].Replace(".","/")}/{packageIds[1]}/{packageIds[1]}-{packageIds[2]}.jar"; - case 4: - if (_IsCommonPackaging(packageIds[2])) - { - return $"/{packageIds[0].Replace(".","/")}/{packageIds[1]}/{packageIds[1]}-{packageIds[3]}.{packageIds[2]}"; - } - return $"/{packageIds[0].Replace(".","/")}/{packageId[1]}/{packageIds[1]}-{packageIds[2]}-{packageIds[3]}.jar"; - case 5: - return $"{packageIds[0].Replace(".","/")}/{packageIds[1]}/{packageIds[1]}-{packageIds[3]}-{packageId[4]}.{packageId[2]}"; - default: - throw new FormatException($"Invalid maven package id: Length is {packageIds.Length}"); - } - } - /// - /// 用于检查是否是 Packaging - /// - private static bool _IsCommonPackaging(string name) - { - return name == "jar" || name == "zip" || name == "pom"; - } +using System; + +namespace PCL.CE.Core.Minecraft; + +/// +/// 用于解析 Maven 包 ID 为 Uri 或 Path +/// +/// +public class MavenArtifact(string mavenId) +{ + /// + /// 将 Maven 包 ID 转换为 Uri 或 Path + /// + /// + /// + public string Resolve(string uriOrPath) + { + return $"{uriOrPath.TrimEnd('/')}{_GetMavenPath(mavenId)}"; + } + + /// + /// 解析 Maven 包 ID + /// + /// 包 ID + /// Maven 包相对路径 (以 / 开头) + /// 给定的 Maven 包 ID 长度过长或过短 + private static string _GetMavenPath(string packageId) + { + var packageIds = packageId.Split(":"); + switch (packageIds.Length) + { + case 3: + return $"/{packageIds[0].Replace(".","/")}/{packageIds[1]}/{packageIds[1]}-{packageIds[2]}.jar"; + case 4: + if (_IsCommonPackaging(packageIds[2])) + { + return $"/{packageIds[0].Replace(".","/")}/{packageIds[1]}/{packageIds[1]}-{packageIds[3]}.{packageIds[2]}"; + } + return $"/{packageIds[0].Replace(".","/")}/{packageId[1]}/{packageIds[1]}-{packageIds[2]}-{packageIds[3]}.jar"; + case 5: + return $"{packageIds[0].Replace(".","/")}/{packageIds[1]}/{packageIds[1]}-{packageIds[3]}-{packageId[4]}.{packageId[2]}"; + default: + throw new FormatException($"Invalid maven package id: Length is {packageIds.Length}"); + } + } + /// + /// 用于检查是否是 Packaging + /// + private static bool _IsCommonPackaging(string name) + { + return name == "jar" || name == "zip" || name == "pom"; + } } \ No newline at end of file diff --git a/PCL.Core/Minecraft/McFormatter.cs b/PCL.CE/Core/Minecraft/McFormatter.cs similarity index 98% rename from PCL.Core/Minecraft/McFormatter.cs rename to PCL.CE/Core/Minecraft/McFormatter.cs index 8cff00fa6..9650ab0b3 100644 --- a/PCL.Core/Minecraft/McFormatter.cs +++ b/PCL.CE/Core/Minecraft/McFormatter.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; public static class McFormatter { public static string GetWikiUrlSuffix(string gameVersion) { diff --git a/PCL.Core/Minecraft/NbtFileHandler.cs b/PCL.CE/Core/Minecraft/NbtFileHandler.cs similarity index 98% rename from PCL.Core/Minecraft/NbtFileHandler.cs rename to PCL.CE/Core/Minecraft/NbtFileHandler.cs index 68abc9a80..258c9085e 100644 --- a/PCL.Core/Minecraft/NbtFileHandler.cs +++ b/PCL.CE/Core/Minecraft/NbtFileHandler.cs @@ -2,10 +2,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; using fNbt; -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; /// /// 提供 NBT 文件的异步读写操作。 diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeAuthors.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeAuthors.cs similarity index 65% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeAuthors.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeAuthors.cs index f54dc3c55..da39749a7 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeAuthors.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeAuthors.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record CurseforgeAuthors( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeCategories.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeCategories.cs similarity index 82% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeCategories.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeCategories.cs index 02f0d4c9e..7af0da474 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeCategories.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeCategories.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record CurseforgeCategories( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeFile.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeFile.cs similarity index 80% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeFile.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeFile.cs index 26eb1ce42..df24583c3 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeFile.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeFile.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record CurseforgeFile( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeHashes.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeHashes.cs similarity index 62% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeHashes.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeHashes.cs index 348a91343..14f146a81 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeHashes.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeHashes.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record CurseforgeHashes( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeLinks.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeLinks.cs similarity index 71% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeLinks.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeLinks.cs index 63fa6b319..4a0e691a3 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeLinks.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeLinks.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record CurseforgeLinks( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgePictures.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgePictures.cs similarity index 74% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgePictures.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgePictures.cs index 50d3c64f2..e1c17bad3 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgePictures.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgePictures.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record CurseforgePictures( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeProject.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeProject.cs similarity index 89% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeProject.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeProject.cs index 2fbb8fb5c..92cb4415c 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeProject.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeProject.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record class CurseforgeProject( diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeResponseData.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeResponseData.cs similarity index 79% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeResponseData.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeResponseData.cs index 981516dd0..a5dd51192 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeResponseData.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeResponseData.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PCL.Core.Minecraft.ResourceProject.Curseforge; +namespace PCL.CE.Core.Minecraft.ResourceProject.Curseforge; [Serializable] public record class CurseforgeProjectResponse(CurseforgeProject data); diff --git a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeScreenshots.cs b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeScreenshots.cs similarity index 74% rename from PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeScreenshots.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeScreenshots.cs index 00ad62ffc..1f1ab2a4d 100644 --- a/PCL.Core/Minecraft/ResourceProject/Curseforge/CurseforgeScreenshots.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Curseforge/CurseforgeScreenshots.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Model.ResourceProject.Curseforge; +namespace PCL.CE.Core.Model.ResourceProject.Curseforge; [Serializable] public record CurseforgeScreenshots( diff --git a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthDonationUrl.cs b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthDonationUrl.cs similarity index 67% rename from PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthDonationUrl.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthDonationUrl.cs index 9343db9d4..d1fe07bc2 100644 --- a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthDonationUrl.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthDonationUrl.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Modrinth; +namespace PCL.CE.Core.Minecraft.ResourceProject.Modrinth; [Serializable] public record ModrinthDonationUrl( diff --git a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthGallery.cs b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthGallery.cs similarity index 75% rename from PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthGallery.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthGallery.cs index 880786e3e..417e2823d 100644 --- a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthGallery.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthGallery.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Modrinth; +namespace PCL.CE.Core.Minecraft.ResourceProject.Modrinth; [Serializable] public record ModrinthGallery( diff --git a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthLicense.cs b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthLicense.cs similarity index 66% rename from PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthLicense.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthLicense.cs index b91607a0b..ee6561927 100644 --- a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthLicense.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthLicense.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Modrinth; +namespace PCL.CE.Core.Minecraft.ResourceProject.Modrinth; [Serializable] public record ModrinthLicense( diff --git a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthModeratorMessage.cs b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthModeratorMessage.cs similarity index 65% rename from PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthModeratorMessage.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthModeratorMessage.cs index 98747de4f..f4e6c41e2 100644 --- a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthModeratorMessage.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthModeratorMessage.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Minecraft.ResourceProject.Modrinth; +namespace PCL.CE.Core.Minecraft.ResourceProject.Modrinth; [Serializable] public record ModrinthModeratorMessage( diff --git a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthProject.cs b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthProject.cs similarity index 94% rename from PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthProject.cs rename to PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthProject.cs index 8a02a06c7..e1200f04a 100644 --- a/PCL.Core/Minecraft/ResourceProject/Modrinth/ModrinthProject.cs +++ b/PCL.CE/Core/Minecraft/ResourceProject/Modrinth/ModrinthProject.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PCL.Core.Minecraft.ResourceProject.Modrinth; +namespace PCL.CE.Core.Minecraft.ResourceProject.Modrinth; [Serializable] public record class ModrinthProject( diff --git a/PCL.Core/Minecraft/ServerAddressResolver.cs b/PCL.CE/Core/Minecraft/ServerAddressResolver.cs similarity index 99% rename from PCL.Core/Minecraft/ServerAddressResolver.cs rename to PCL.CE/Core/Minecraft/ServerAddressResolver.cs index 7c33a51b1..d08718f58 100644 --- a/PCL.Core/Minecraft/ServerAddressResolver.cs +++ b/PCL.CE/Core/Minecraft/ServerAddressResolver.cs @@ -9,11 +9,11 @@ using System.Threading.Tasks; using Ae.Dns.Protocol.Enums; using Ae.Dns.Protocol.Records; -using PCL.Core.IO.Net.Dns; -using PCL.Core.Logging; -using PCL.Core.Utils; +using PCL.CE.Core.IO.Net.Dns; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; -namespace PCL.Core.Minecraft; +namespace PCL.CE.Core.Minecraft; public static class ServerAddressResolver { diff --git a/PCL.Core/Minecraft/Yggdrasil/ApiLocation.cs b/PCL.CE/Core/Minecraft/Yggdrasil/ApiLocation.cs similarity index 89% rename from PCL.Core/Minecraft/Yggdrasil/ApiLocation.cs rename to PCL.CE/Core/Minecraft/Yggdrasil/ApiLocation.cs index 1c2269c2e..b963da275 100644 --- a/PCL.Core/Minecraft/Yggdrasil/ApiLocation.cs +++ b/PCL.CE/Core/Minecraft/Yggdrasil/ApiLocation.cs @@ -1,34 +1,34 @@ -using System; -using System.Threading.Tasks; -using PCL.Core.IO.Net.Http.Client.Request; - -namespace PCL.Core.Minecraft.Yggdrasil; - -public static class ApiLocation -{ - public static async Task TryRequestAsync(string address) - { - var originAddr = address.StartsWith("http") ? address : $"https://{address}"; - var originUri = new Uri(originAddr); - using var response = await HttpRequest - .CreateHead(originAddr) - .SendAsync(); - - - if (!response.TryGetHeader("X-Authlib-Injector-Api-Location", out var location) - || location.Length == 0) - return originAddr; - - // TODO: use schema instead - var resultAddr = location[0]; - - if (string.IsNullOrEmpty(resultAddr)) return originAddr; - if (resultAddr.StartsWith(originUri.Scheme)) return resultAddr; - // 不允许 HTTPS 降 HTTP - if (resultAddr.StartsWith("http:") && originUri.Scheme == "https") - return resultAddr.Replace("http","https"); - - return new Uri(originUri, resultAddr).ToString(); - } -} - +using System; +using System.Threading.Tasks; +using PCL.CE.Core.IO.Net.Http.Client.Request; + +namespace PCL.CE.Core.Minecraft.Yggdrasil; + +public static class ApiLocation +{ + public static async Task TryRequestAsync(string address) + { + var originAddr = address.StartsWith("http") ? address : $"https://{address}"; + var originUri = new Uri(originAddr); + using var response = await HttpRequest + .CreateHead(originAddr) + .SendAsync(); + + + if (!response.TryGetHeader("X-Authlib-Injector-Api-Location", out var location) + || location.Length == 0) + return originAddr; + + // TODO: use schema instead + var resultAddr = location[0]; + + if (string.IsNullOrEmpty(resultAddr)) return originAddr; + if (resultAddr.StartsWith(originUri.Scheme)) return resultAddr; + // 不允许 HTTPS 降 HTTP + if (resultAddr.StartsWith("http:") && originUri.Scheme == "https") + return resultAddr.Replace("http","https"); + + return new Uri(originUri, resultAddr).ToString(); + } +} + diff --git a/PCL.Core/Model/Homepage/News/ApiResponse.cs b/PCL.CE/Core/Model/Homepage/News/ApiResponse.cs similarity index 78% rename from PCL.Core/Model/Homepage/News/ApiResponse.cs rename to PCL.CE/Core/Model/Homepage/News/ApiResponse.cs index de4885d61..7481260dc 100644 --- a/PCL.Core/Model/Homepage/News/ApiResponse.cs +++ b/PCL.CE/Core/Model/Homepage/News/ApiResponse.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.Model.Tools.News; +namespace PCL.CE.Core.Model.Tools.News; public class ApiResponse { diff --git a/PCL.Core/Model/Homepage/News/NewsItem.cs b/PCL.CE/Core/Model/Homepage/News/NewsItem.cs similarity index 95% rename from PCL.Core/Model/Homepage/News/NewsItem.cs rename to PCL.CE/Core/Model/Homepage/News/NewsItem.cs index 194044d10..c92797a89 100644 --- a/PCL.Core/Model/Homepage/News/NewsItem.cs +++ b/PCL.CE/Core/Model/Homepage/News/NewsItem.cs @@ -1,7 +1,7 @@ using System; using System.Text.Json.Serialization; -namespace PCL.Core.Model.Tools.News; +namespace PCL.CE.Core.Model.Tools.News; public class NewsItem { diff --git a/PCL.Core/Model/Homepage/News/Result.cs b/PCL.CE/Core/Model/Homepage/News/Result.cs similarity index 89% rename from PCL.Core/Model/Homepage/News/Result.cs rename to PCL.CE/Core/Model/Homepage/News/Result.cs index 544918396..6ab3ee7fa 100644 --- a/PCL.Core/Model/Homepage/News/Result.cs +++ b/PCL.CE/Core/Model/Homepage/News/Result.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace PCL.Core.Model.Tools.News; +namespace PCL.CE.Core.Model.Tools.News; public class Result { diff --git a/PCL.Core/UI/Animation/Animatable/ClrAnimatable.cs b/PCL.CE/Core/UI/Animation/Animatable/ClrAnimatable.cs similarity index 94% rename from PCL.Core/UI/Animation/Animatable/ClrAnimatable.cs rename to PCL.CE/Core/UI/Animation/Animatable/ClrAnimatable.cs index 90b00404f..264ff083d 100644 --- a/PCL.Core/UI/Animation/Animatable/ClrAnimatable.cs +++ b/PCL.CE/Core/UI/Animation/Animatable/ClrAnimatable.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Animatable; +namespace PCL.CE.Core.UI.Animation.Animatable; public sealed class ClrAnimatable : IAnimatable { diff --git a/PCL.Core/UI/Animation/Animatable/IAnimatable.cs b/PCL.CE/Core/UI/Animation/Animatable/IAnimatable.cs similarity index 67% rename from PCL.Core/UI/Animation/Animatable/IAnimatable.cs rename to PCL.CE/Core/UI/Animation/Animatable/IAnimatable.cs index 3a9105d01..311a4d811 100644 --- a/PCL.Core/UI/Animation/Animatable/IAnimatable.cs +++ b/PCL.CE/Core/UI/Animation/Animatable/IAnimatable.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Animatable; +namespace PCL.CE.Core.UI.Animation.Animatable; public interface IAnimatable { diff --git a/PCL.Core/UI/Animation/Animatable/WpfAnimatable.cs b/PCL.CE/Core/UI/Animation/Animatable/WpfAnimatable.cs similarity index 91% rename from PCL.Core/UI/Animation/Animatable/WpfAnimatable.cs rename to PCL.CE/Core/UI/Animation/Animatable/WpfAnimatable.cs index 9cd9e2e21..791f2c042 100644 --- a/PCL.Core/UI/Animation/Animatable/WpfAnimatable.cs +++ b/PCL.CE/Core/UI/Animation/Animatable/WpfAnimatable.cs @@ -1,8 +1,8 @@ using System; using System.Windows; -using PCL.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.UI.Animation.ValueProcessor; -namespace PCL.Core.UI.Animation.Animatable; +namespace PCL.CE.Core.UI.Animation.Animatable; public sealed class WpfAnimatable(DependencyObject owner, DependencyProperty? property) : IAnimatable { diff --git a/PCL.Core/UI/Animation/Clock/IClock.cs b/PCL.CE/Core/UI/Animation/Clock/IClock.cs similarity index 93% rename from PCL.Core/UI/Animation/Clock/IClock.cs rename to PCL.CE/Core/UI/Animation/Clock/IClock.cs index b07bbe44a..f78532f31 100644 --- a/PCL.Core/UI/Animation/Clock/IClock.cs +++ b/PCL.CE/Core/UI/Animation/Clock/IClock.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; -namespace PCL.Core.UI.Animation.Clock; +namespace PCL.CE.Core.UI.Animation.Clock; public interface IClock { diff --git a/PCL.Core/UI/Animation/Clock/IUIClock.cs b/PCL.CE/Core/UI/Animation/Clock/IUIClock.cs similarity index 63% rename from PCL.Core/UI/Animation/Clock/IUIClock.cs rename to PCL.CE/Core/UI/Animation/Clock/IUIClock.cs index eafe4122c..efbfe2670 100644 --- a/PCL.Core/UI/Animation/Clock/IUIClock.cs +++ b/PCL.CE/Core/UI/Animation/Clock/IUIClock.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Clock; +namespace PCL.CE.Core.UI.Animation.Clock; /// /// diff --git a/PCL.Core/UI/Animation/Clock/StopwatchClock.cs b/PCL.CE/Core/UI/Animation/Clock/StopwatchClock.cs similarity index 94% rename from PCL.Core/UI/Animation/Clock/StopwatchClock.cs rename to PCL.CE/Core/UI/Animation/Clock/StopwatchClock.cs index 7d36a1c9c..900235d69 100644 --- a/PCL.Core/UI/Animation/Clock/StopwatchClock.cs +++ b/PCL.CE/Core/UI/Animation/Clock/StopwatchClock.cs @@ -2,10 +2,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using PCL.Core.UI.Animation.Core; -using PCL.Core.Utils; +using PCL.CE.Core.UI.Animation.Core; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Clock; +namespace PCL.CE.Core.UI.Animation.Clock; /// /// 一个基于 Stopwatch 的时钟实现。 diff --git a/PCL.Core/UI/Animation/Clock/WinMMClock.cs b/PCL.CE/Core/UI/Animation/Clock/WinMMClock.cs similarity index 97% rename from PCL.Core/UI/Animation/Clock/WinMMClock.cs rename to PCL.CE/Core/UI/Animation/Clock/WinMMClock.cs index eb580debb..187471061 100644 --- a/PCL.Core/UI/Animation/Clock/WinMMClock.cs +++ b/PCL.CE/Core/UI/Animation/Clock/WinMMClock.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace PCL.Core.UI.Animation.Clock; +namespace PCL.CE.Core.UI.Animation.Clock; public sealed partial class WinMMClock(int fps = 60) : IClock, IDisposable { diff --git a/PCL.Core/UI/Animation/Clock/WpfCompositionTargetRenderingClock.cs b/PCL.CE/Core/UI/Animation/Clock/WpfCompositionTargetRenderingClock.cs similarity index 97% rename from PCL.Core/UI/Animation/Clock/WpfCompositionTargetRenderingClock.cs rename to PCL.CE/Core/UI/Animation/Clock/WpfCompositionTargetRenderingClock.cs index 2dc70d413..eb45abf5c 100644 --- a/PCL.Core/UI/Animation/Clock/WpfCompositionTargetRenderingClock.cs +++ b/PCL.CE/Core/UI/Animation/Clock/WpfCompositionTargetRenderingClock.cs @@ -3,9 +3,9 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Media; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Clock; +namespace PCL.CE.Core.UI.Animation.Clock; /// /// 一个基于 WPF CompositionTarget.Rendering 事件的时钟实现。 diff --git a/PCL.Core/UI/Animation/Core/AnimationBase.cs b/PCL.CE/Core/UI/Animation/Core/AnimationBase.cs similarity index 89% rename from PCL.Core/UI/Animation/Core/AnimationBase.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationBase.cs index 57d55de15..bade33453 100644 --- a/PCL.Core/UI/Animation/Core/AnimationBase.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationBase.cs @@ -1,9 +1,9 @@ using System; using System.Threading.Tasks; using System.Windows; -using PCL.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Animatable; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public abstract class AnimationBase : DependencyObject, IAnimation { diff --git a/PCL.Core/UI/Animation/Core/AnimationData.cs b/PCL.CE/Core/UI/Animation/Core/AnimationData.cs similarity index 84% rename from PCL.Core/UI/Animation/Core/AnimationData.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationData.cs index f65343a66..c73532d53 100644 --- a/PCL.Core/UI/Animation/Core/AnimationData.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationData.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Frozen; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public record AnimationData : IAnimationData { diff --git a/PCL.Core/UI/Animation/Core/AnimationExtensions.cs b/PCL.CE/Core/UI/Animation/Core/AnimationExtensions.cs similarity index 97% rename from PCL.Core/UI/Animation/Core/AnimationExtensions.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationExtensions.cs index 61d58a069..0762213f1 100644 --- a/PCL.Core/UI/Animation/Core/AnimationExtensions.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationExtensions.cs @@ -3,9 +3,9 @@ using System.Windows; using System.Windows.Markup; using System.Windows.Media; -using PCL.Core.UI.Animation.Easings; +using PCL.CE.Core.UI.Animation.Easings; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public static class AnimationExtensions { diff --git a/PCL.Core/UI/Animation/Core/AnimationFrame.cs b/PCL.CE/Core/UI/Animation/Core/AnimationFrame.cs similarity index 74% rename from PCL.Core/UI/Animation/Core/AnimationFrame.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationFrame.cs index 255a2c895..de0fc62c4 100644 --- a/PCL.Core/UI/Animation/Core/AnimationFrame.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationFrame.cs @@ -1,9 +1,9 @@ using System; using System.Numerics; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.ValueProcessor; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public readonly struct AnimationFrame : IAnimationFrame where T : struct { diff --git a/PCL.Core/UI/Animation/Core/AnimationGroup.cs b/PCL.CE/Core/UI/Animation/Core/AnimationGroup.cs similarity index 95% rename from PCL.Core/UI/Animation/Core/AnimationGroup.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationGroup.cs index 172d11671..deffdcc2e 100644 --- a/PCL.Core/UI/Animation/Core/AnimationGroup.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationGroup.cs @@ -3,10 +3,10 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Markup; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.Utils; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; /// /// 动画组的基类。 diff --git a/PCL.Core/UI/Animation/Core/AnimationService.cs b/PCL.CE/Core/UI/Animation/Core/AnimationService.cs similarity index 95% rename from PCL.Core/UI/Animation/Core/AnimationService.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationService.cs index 2340ca3af..b036072af 100644 --- a/PCL.Core/UI/Animation/Core/AnimationService.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationService.cs @@ -3,15 +3,15 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; -using PCL.Core.App; -using PCL.Core.App.IoC; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Clock; -using PCL.Core.UI.Animation.UIAccessProvider; -using PCL.Core.UI.Animation.ValueProcessor; -using PCL.Core.Utils.Threading; +using PCL.CE.Core.App; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Clock; +using PCL.CE.Core.UI.Animation.UIAccessProvider; +using PCL.CE.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.Utils.Threading; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; [LifecycleService(LifecycleState.WindowCreating)] public sealed class AnimationService : GeneralService diff --git a/PCL.Core/UI/Animation/Core/AnimationValueType.cs b/PCL.CE/Core/UI/Animation/Core/AnimationValueType.cs similarity index 85% rename from PCL.Core/UI/Animation/Core/AnimationValueType.cs rename to PCL.CE/Core/UI/Animation/Core/AnimationValueType.cs index 9055c17c7..32f13c417 100644 --- a/PCL.Core/UI/Animation/Core/AnimationValueType.cs +++ b/PCL.CE/Core/UI/Animation/Core/AnimationValueType.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; /// /// 用于指定动画值的解释方式。。 diff --git a/PCL.Core/UI/Animation/Core/FromToAnimationBase.cs b/PCL.CE/Core/UI/Animation/Core/FromToAnimationBase.cs similarity index 94% rename from PCL.Core/UI/Animation/Core/FromToAnimationBase.cs rename to PCL.CE/Core/UI/Animation/Core/FromToAnimationBase.cs index 88eda2f31..6cb3e7e7f 100644 --- a/PCL.Core/UI/Animation/Core/FromToAnimationBase.cs +++ b/PCL.CE/Core/UI/Animation/Core/FromToAnimationBase.cs @@ -1,11 +1,11 @@ using System; using System.Numerics; using System.Threading.Tasks; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Easings; -using PCL.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Easings; +using PCL.CE.Core.UI.Animation.ValueProcessor; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public class FromToAnimationBase : AnimationBase, IFromToAnimation where T : struct { diff --git a/PCL.Core/UI/Animation/Core/IAnimation.cs b/PCL.CE/Core/UI/Animation/Core/IAnimation.cs similarity index 94% rename from PCL.Core/UI/Animation/Core/IAnimation.cs rename to PCL.CE/Core/UI/Animation/Core/IAnimation.cs index 1ce98c8a4..03284f297 100644 --- a/PCL.Core/UI/Animation/Core/IAnimation.cs +++ b/PCL.CE/Core/UI/Animation/Core/IAnimation.cs @@ -1,8 +1,8 @@ using System; using System.Threading.Tasks; -using PCL.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Animatable; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public interface IAnimation { diff --git a/PCL.CE/Core/UI/Animation/Core/IAnimationData.cs b/PCL.CE/Core/UI/Animation/Core/IAnimationData.cs new file mode 100644 index 000000000..1789e75c8 --- /dev/null +++ b/PCL.CE/Core/UI/Animation/Core/IAnimationData.cs @@ -0,0 +1,6 @@ +namespace PCL.CE.Core.UI.Animation.Core; + +public interface IAnimationData +{ + +} \ No newline at end of file diff --git a/PCL.Core/UI/Animation/Core/IAnimationFrame.cs b/PCL.CE/Core/UI/Animation/Core/IAnimationFrame.cs similarity index 60% rename from PCL.Core/UI/Animation/Core/IAnimationFrame.cs rename to PCL.CE/Core/UI/Animation/Core/IAnimationFrame.cs index 7a93143db..8d0b9417a 100644 --- a/PCL.Core/UI/Animation/Core/IAnimationFrame.cs +++ b/PCL.CE/Core/UI/Animation/Core/IAnimationFrame.cs @@ -1,7 +1,7 @@ using System.Windows; -using PCL.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Animatable; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public interface IAnimationFrame { diff --git a/PCL.Core/UI/Animation/Core/IFromToAnimation.cs b/PCL.CE/Core/UI/Animation/Core/IFromToAnimation.cs similarity index 74% rename from PCL.Core/UI/Animation/Core/IFromToAnimation.cs rename to PCL.CE/Core/UI/Animation/Core/IFromToAnimation.cs index 2e43cc132..dbb2d7082 100644 --- a/PCL.Core/UI/Animation/Core/IFromToAnimation.cs +++ b/PCL.CE/Core/UI/Animation/Core/IFromToAnimation.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public interface IFromToAnimation : IAnimation { diff --git a/PCL.Core/UI/Animation/Core/IImplicitAnimation.cs b/PCL.CE/Core/UI/Animation/Core/IImplicitAnimation.cs similarity index 62% rename from PCL.Core/UI/Animation/Core/IImplicitAnimation.cs rename to PCL.CE/Core/UI/Animation/Core/IImplicitAnimation.cs index cedfe3764..f1c6f7217 100644 --- a/PCL.Core/UI/Animation/Core/IImplicitAnimation.cs +++ b/PCL.CE/Core/UI/Animation/Core/IImplicitAnimation.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public interface IImplicitAnimation { diff --git a/PCL.Core/UI/Animation/Core/IKeyFrameAnimation.cs b/PCL.CE/Core/UI/Animation/Core/IKeyFrameAnimation.cs similarity index 63% rename from PCL.Core/UI/Animation/Core/IKeyFrameAnimation.cs rename to PCL.CE/Core/UI/Animation/Core/IKeyFrameAnimation.cs index 00564dc43..bba5f2bcd 100644 --- a/PCL.Core/UI/Animation/Core/IKeyFrameAnimation.cs +++ b/PCL.CE/Core/UI/Animation/Core/IKeyFrameAnimation.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; public interface IKeyFrameAnimation { diff --git a/PCL.Core/UI/Animation/Core/ParallelAnimationGroup.cs b/PCL.CE/Core/UI/Animation/Core/ParallelAnimationGroup.cs similarity index 90% rename from PCL.Core/UI/Animation/Core/ParallelAnimationGroup.cs rename to PCL.CE/Core/UI/Animation/Core/ParallelAnimationGroup.cs index fb4a6d3fb..831f61ed2 100644 --- a/PCL.Core/UI/Animation/Core/ParallelAnimationGroup.cs +++ b/PCL.CE/Core/UI/Animation/Core/ParallelAnimationGroup.cs @@ -1,8 +1,8 @@ using System.Linq; using System.Threading.Tasks; -using PCL.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Animatable; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; /// /// 同时执行的动画集合。 diff --git a/PCL.Core/UI/Animation/Core/RunAnimation.cs b/PCL.CE/Core/UI/Animation/Core/RunAnimation.cs similarity index 96% rename from PCL.Core/UI/Animation/Core/RunAnimation.cs rename to PCL.CE/Core/UI/Animation/Core/RunAnimation.cs index 771d17229..bbc16ea11 100644 --- a/PCL.Core/UI/Animation/Core/RunAnimation.cs +++ b/PCL.CE/Core/UI/Animation/Core/RunAnimation.cs @@ -4,10 +4,10 @@ using System.Windows.Data; using System.Windows.Markup; using Microsoft.Xaml.Behaviors; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.Utils; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; [ContentProperty(nameof(Animation))] public class RunAnimation : TriggerAction diff --git a/PCL.Core/UI/Animation/Core/SequentialAnimationGroup.cs b/PCL.CE/Core/UI/Animation/Core/SequentialAnimationGroup.cs similarity index 88% rename from PCL.Core/UI/Animation/Core/SequentialAnimationGroup.cs rename to PCL.CE/Core/UI/Animation/Core/SequentialAnimationGroup.cs index 6a3792015..6afa9f505 100644 --- a/PCL.Core/UI/Animation/Core/SequentialAnimationGroup.cs +++ b/PCL.CE/Core/UI/Animation/Core/SequentialAnimationGroup.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using PCL.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Animatable; -namespace PCL.Core.UI.Animation.Core; +namespace PCL.CE.Core.UI.Animation.Core; /// /// 按顺序执行的动画集合。 diff --git a/PCL.Core/UI/Animation/DoubleFromToAnimation.cs b/PCL.CE/Core/UI/Animation/DoubleFromToAnimation.cs similarity index 80% rename from PCL.Core/UI/Animation/DoubleFromToAnimation.cs rename to PCL.CE/Core/UI/Animation/DoubleFromToAnimation.cs index b2331996e..d528ebbcf 100644 --- a/PCL.Core/UI/Animation/DoubleFromToAnimation.cs +++ b/PCL.CE/Core/UI/Animation/DoubleFromToAnimation.cs @@ -1,7 +1,7 @@ -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Core; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Core; -namespace PCL.Core.UI.Animation; +namespace PCL.CE.Core.UI.Animation; public sealed class DoubleFromToAnimation : FromToAnimationBase { diff --git a/PCL.Core/UI/Animation/Easings/BackEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/BackEaseIn.cs similarity index 82% rename from PCL.Core/UI/Animation/Easings/BackEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/BackEaseIn.cs index 928367b99..755b283ed 100644 --- a/PCL.Core/UI/Animation/Easings/BackEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/BackEaseIn.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class BackEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/BackEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/BackEaseInOut.cs similarity index 90% rename from PCL.Core/UI/Animation/Easings/BackEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/BackEaseInOut.cs index 07a79eced..475ef5996 100644 --- a/PCL.Core/UI/Animation/Easings/BackEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/BackEaseInOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class BackEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/BackEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/BackEaseOut.cs similarity index 82% rename from PCL.Core/UI/Animation/Easings/BackEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/BackEaseOut.cs index 60578e15c..756fd3561 100644 --- a/PCL.Core/UI/Animation/Easings/BackEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/BackEaseOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class BackEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/BounceEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/BounceEaseIn.cs similarity index 68% rename from PCL.Core/UI/Animation/Easings/BounceEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/BounceEaseIn.cs index e5491fdca..1aa43d543 100644 --- a/PCL.Core/UI/Animation/Easings/BounceEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/BounceEaseIn.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class BounceEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/BounceEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/BounceEaseInOut.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/BounceEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/BounceEaseInOut.cs index 261fa2d87..6337b2734 100644 --- a/PCL.Core/UI/Animation/Easings/BounceEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/BounceEaseInOut.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class BounceEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/BounceEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/BounceEaseOut.cs similarity index 67% rename from PCL.Core/UI/Animation/Easings/BounceEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/BounceEaseOut.cs index 412351e6b..396319492 100644 --- a/PCL.Core/UI/Animation/Easings/BounceEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/BounceEaseOut.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class BounceEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/CircularEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/CircularEaseIn.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/CircularEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/CircularEaseIn.cs index 8a29c2227..12eb274d2 100644 --- a/PCL.Core/UI/Animation/Easings/CircularEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/CircularEaseIn.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class CircularEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/CircularEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/CircularEaseInOut.cs similarity index 88% rename from PCL.Core/UI/Animation/Easings/CircularEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/CircularEaseInOut.cs index edcaed1a5..d9396f0a3 100644 --- a/PCL.Core/UI/Animation/Easings/CircularEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/CircularEaseInOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class CircularEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/CircularEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/CircularEaseOut.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/CircularEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/CircularEaseOut.cs index 799554933..3f937edaa 100644 --- a/PCL.Core/UI/Animation/Easings/CircularEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/CircularEaseOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class CircularEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/CubicEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/CubicEaseIn.cs similarity index 76% rename from PCL.Core/UI/Animation/Easings/CubicEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/CubicEaseIn.cs index 6db012f1b..cf282e992 100644 --- a/PCL.Core/UI/Animation/Easings/CubicEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/CubicEaseIn.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class CubicEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/CubicEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/CubicEaseInOut.cs similarity index 85% rename from PCL.Core/UI/Animation/Easings/CubicEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/CubicEaseInOut.cs index 284be5a90..389ac2fef 100644 --- a/PCL.Core/UI/Animation/Easings/CubicEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/CubicEaseInOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class CubicEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/CubicEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/CubicEaseOut.cs similarity index 78% rename from PCL.Core/UI/Animation/Easings/CubicEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/CubicEaseOut.cs index 35a607769..14b21c430 100644 --- a/PCL.Core/UI/Animation/Easings/CubicEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/CubicEaseOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class CubicEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/Easing.cs b/PCL.CE/Core/UI/Animation/Easings/Easing.cs similarity index 91% rename from PCL.Core/UI/Animation/Easings/Easing.cs rename to PCL.CE/Core/UI/Animation/Easings/Easing.cs index dfd7ee7ea..1c85c3235 100644 --- a/PCL.Core/UI/Animation/Easings/Easing.cs +++ b/PCL.CE/Core/UI/Animation/Easings/Easing.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; /// /// 所有缓动类的基类。 diff --git a/PCL.Core/UI/Animation/Easings/ElasticEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/ElasticEaseIn.cs similarity index 79% rename from PCL.Core/UI/Animation/Easings/ElasticEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/ElasticEaseIn.cs index c423fa224..2f89c71e8 100644 --- a/PCL.Core/UI/Animation/Easings/ElasticEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/ElasticEaseIn.cs @@ -1,7 +1,7 @@ using System; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class ElasticEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/ElasticEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/ElasticEaseInOut.cs similarity index 89% rename from PCL.Core/UI/Animation/Easings/ElasticEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/ElasticEaseInOut.cs index c7cc60fd0..71c410cd2 100644 --- a/PCL.Core/UI/Animation/Easings/ElasticEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/ElasticEaseInOut.cs @@ -1,7 +1,7 @@ using System; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class ElasticEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/ElasticEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/ElasticEaseOut.cs similarity index 79% rename from PCL.Core/UI/Animation/Easings/ElasticEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/ElasticEaseOut.cs index efd0025a9..f8a8929fb 100644 --- a/PCL.Core/UI/Animation/Easings/ElasticEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/ElasticEaseOut.cs @@ -1,7 +1,7 @@ using System; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class ElasticEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/ExponentialEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/ExponentialEaseIn.cs similarity index 82% rename from PCL.Core/UI/Animation/Easings/ExponentialEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/ExponentialEaseIn.cs index fc5061b12..5f5f2724b 100644 --- a/PCL.Core/UI/Animation/Easings/ExponentialEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/ExponentialEaseIn.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class ExponentialEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/ExponentialEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/ExponentialEaseInOut.cs similarity index 87% rename from PCL.Core/UI/Animation/Easings/ExponentialEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/ExponentialEaseInOut.cs index bb6528114..6bd952c28 100644 --- a/PCL.Core/UI/Animation/Easings/ExponentialEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/ExponentialEaseInOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class ExponentialEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/ExponentialEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/ExponentialEaseOut.cs similarity index 83% rename from PCL.Core/UI/Animation/Easings/ExponentialEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/ExponentialEaseOut.cs index c5958041d..b2164b017 100644 --- a/PCL.Core/UI/Animation/Easings/ExponentialEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/ExponentialEaseOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class ExponentialEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/IEasing.cs b/PCL.CE/Core/UI/Animation/Easings/IEasing.cs similarity index 89% rename from PCL.Core/UI/Animation/Easings/IEasing.cs rename to PCL.CE/Core/UI/Animation/Easings/IEasing.cs index 2151ff3df..fd8ac2378 100644 --- a/PCL.Core/UI/Animation/Easings/IEasing.cs +++ b/PCL.CE/Core/UI/Animation/Easings/IEasing.cs @@ -1,7 +1,7 @@ using System.ComponentModel; -using PCL.Core.UI.Converters; +using PCL.CE.Core.UI.Converters; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; /// /// 定义了缓动类的接口。 diff --git a/PCL.Core/UI/Animation/Easings/LinearEasing.cs b/PCL.CE/Core/UI/Animation/Easings/LinearEasing.cs similarity index 73% rename from PCL.Core/UI/Animation/Easings/LinearEasing.cs rename to PCL.CE/Core/UI/Animation/Easings/LinearEasing.cs index ef3751526..59e864908 100644 --- a/PCL.Core/UI/Animation/Easings/LinearEasing.cs +++ b/PCL.CE/Core/UI/Animation/Easings/LinearEasing.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class LinearEasing : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuadEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/QuadEaseIn.cs similarity index 75% rename from PCL.Core/UI/Animation/Easings/QuadEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/QuadEaseIn.cs index 9baf5363b..c71b08ddc 100644 --- a/PCL.Core/UI/Animation/Easings/QuadEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuadEaseIn.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuadEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuadEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/QuadEaseInOut.cs similarity index 84% rename from PCL.Core/UI/Animation/Easings/QuadEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/QuadEaseInOut.cs index 6f79dc8d9..ebec9e1fb 100644 --- a/PCL.Core/UI/Animation/Easings/QuadEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuadEaseInOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuadEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuadEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/QuadEaseOut.cs similarity index 77% rename from PCL.Core/UI/Animation/Easings/QuadEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/QuadEaseOut.cs index 85477f80d..fb9474b0f 100644 --- a/PCL.Core/UI/Animation/Easings/QuadEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuadEaseOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuadEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuarticEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/QuarticEaseIn.cs similarity index 78% rename from PCL.Core/UI/Animation/Easings/QuarticEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/QuarticEaseIn.cs index 23f180db2..2eaa079d1 100644 --- a/PCL.Core/UI/Animation/Easings/QuarticEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuarticEaseIn.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuarticEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuarticEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/QuarticEaseInOut.cs similarity index 87% rename from PCL.Core/UI/Animation/Easings/QuarticEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/QuarticEaseInOut.cs index 70a42bc7d..ee5695f35 100644 --- a/PCL.Core/UI/Animation/Easings/QuarticEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuarticEaseInOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuarticEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuarticEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/QuarticEaseOut.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/QuarticEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/QuarticEaseOut.cs index 454e70662..fc8727133 100644 --- a/PCL.Core/UI/Animation/Easings/QuarticEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuarticEaseOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuarticEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuinticEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/QuinticEaseIn.cs similarity index 79% rename from PCL.Core/UI/Animation/Easings/QuinticEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/QuinticEaseIn.cs index 842fe0e16..33b151bef 100644 --- a/PCL.Core/UI/Animation/Easings/QuinticEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuinticEaseIn.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuinticEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuinticEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/QuinticEaseInOut.cs similarity index 87% rename from PCL.Core/UI/Animation/Easings/QuinticEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/QuinticEaseInOut.cs index 1ef718985..8721ab98b 100644 --- a/PCL.Core/UI/Animation/Easings/QuinticEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuinticEaseInOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuinticEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/QuinticEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/QuinticEaseOut.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/QuinticEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/QuinticEaseOut.cs index b0c7d7e0d..2548aac7b 100644 --- a/PCL.Core/UI/Animation/Easings/QuinticEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/QuinticEaseOut.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class QuinticEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/SineEaseIn.cs b/PCL.CE/Core/UI/Animation/Easings/SineEaseIn.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/SineEaseIn.cs rename to PCL.CE/Core/UI/Animation/Easings/SineEaseIn.cs index 2e9f96f6a..1cebd3fc2 100644 --- a/PCL.Core/UI/Animation/Easings/SineEaseIn.cs +++ b/PCL.CE/Core/UI/Animation/Easings/SineEaseIn.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class SineEaseIn : Easing { diff --git a/PCL.Core/UI/Animation/Easings/SineEaseInOut.cs b/PCL.CE/Core/UI/Animation/Easings/SineEaseInOut.cs similarity index 80% rename from PCL.Core/UI/Animation/Easings/SineEaseInOut.cs rename to PCL.CE/Core/UI/Animation/Easings/SineEaseInOut.cs index f6d2de93b..66a309a59 100644 --- a/PCL.Core/UI/Animation/Easings/SineEaseInOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/SineEaseInOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class SineEaseInOut : Easing { diff --git a/PCL.Core/UI/Animation/Easings/SineEaseOut.cs b/PCL.CE/Core/UI/Animation/Easings/SineEaseOut.cs similarity index 79% rename from PCL.Core/UI/Animation/Easings/SineEaseOut.cs rename to PCL.CE/Core/UI/Animation/Easings/SineEaseOut.cs index b4c114b03..2c80519f6 100644 --- a/PCL.Core/UI/Animation/Easings/SineEaseOut.cs +++ b/PCL.CE/Core/UI/Animation/Easings/SineEaseOut.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.Easings; +namespace PCL.CE.Core.UI.Animation.Easings; public class SineEaseOut : Easing { diff --git a/PCL.Core/UI/Animation/MatrixFromToAnimation.cs b/PCL.CE/Core/UI/Animation/MatrixFromToAnimation.cs similarity index 80% rename from PCL.Core/UI/Animation/MatrixFromToAnimation.cs rename to PCL.CE/Core/UI/Animation/MatrixFromToAnimation.cs index bf8d71990..cf5e5f542 100644 --- a/PCL.Core/UI/Animation/MatrixFromToAnimation.cs +++ b/PCL.CE/Core/UI/Animation/MatrixFromToAnimation.cs @@ -1,9 +1,9 @@ using System.Windows.Media; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Core; -using PCL.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Core; +using PCL.CE.Core.UI.Animation.ValueProcessor; -namespace PCL.Core.UI.Animation; +namespace PCL.CE.Core.UI.Animation; public class MatrixFromToAnimation : FromToAnimationBase { diff --git a/PCL.Core/UI/Animation/NColorFromToAnimation.cs b/PCL.CE/Core/UI/Animation/NColorFromToAnimation.cs similarity index 81% rename from PCL.Core/UI/Animation/NColorFromToAnimation.cs rename to PCL.CE/Core/UI/Animation/NColorFromToAnimation.cs index f5843939f..c1bed2564 100644 --- a/PCL.Core/UI/Animation/NColorFromToAnimation.cs +++ b/PCL.CE/Core/UI/Animation/NColorFromToAnimation.cs @@ -1,7 +1,7 @@ -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Core; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Core; -namespace PCL.Core.UI.Animation; +namespace PCL.CE.Core.UI.Animation; public class NColorFromToAnimation : FromToAnimationBase { diff --git a/PCL.Core/UI/Animation/PointFromToAnimation.cs b/PCL.CE/Core/UI/Animation/PointFromToAnimation.cs similarity index 80% rename from PCL.Core/UI/Animation/PointFromToAnimation.cs rename to PCL.CE/Core/UI/Animation/PointFromToAnimation.cs index f44329550..42cbf5ad5 100644 --- a/PCL.Core/UI/Animation/PointFromToAnimation.cs +++ b/PCL.CE/Core/UI/Animation/PointFromToAnimation.cs @@ -1,9 +1,9 @@ using System.Windows; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Core; -using PCL.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Core; +using PCL.CE.Core.UI.Animation.ValueProcessor; -namespace PCL.Core.UI.Animation; +namespace PCL.CE.Core.UI.Animation; public class PointFromToAnimation : FromToAnimationBase { diff --git a/PCL.Core/UI/Animation/ThicknessFromToAnimation.cs b/PCL.CE/Core/UI/Animation/ThicknessFromToAnimation.cs similarity index 80% rename from PCL.Core/UI/Animation/ThicknessFromToAnimation.cs rename to PCL.CE/Core/UI/Animation/ThicknessFromToAnimation.cs index a7a328c9e..98825da8f 100644 --- a/PCL.Core/UI/Animation/ThicknessFromToAnimation.cs +++ b/PCL.CE/Core/UI/Animation/ThicknessFromToAnimation.cs @@ -1,9 +1,9 @@ using System.Windows; -using PCL.Core.UI.Animation.Animatable; -using PCL.Core.UI.Animation.Core; -using PCL.Core.UI.Animation.ValueProcessor; +using PCL.CE.Core.UI.Animation.Animatable; +using PCL.CE.Core.UI.Animation.Core; +using PCL.CE.Core.UI.Animation.ValueProcessor; -namespace PCL.Core.UI.Animation; +namespace PCL.CE.Core.UI.Animation; public class ThicknessFromToAnimation : FromToAnimationBase { diff --git a/PCL.Core/UI/Animation/UIAccessProvider/IUIAccessProvider.cs b/PCL.CE/Core/UI/Animation/UIAccessProvider/IUIAccessProvider.cs similarity index 95% rename from PCL.Core/UI/Animation/UIAccessProvider/IUIAccessProvider.cs rename to PCL.CE/Core/UI/Animation/UIAccessProvider/IUIAccessProvider.cs index a4ba19c85..9e5b49202 100644 --- a/PCL.Core/UI/Animation/UIAccessProvider/IUIAccessProvider.cs +++ b/PCL.CE/Core/UI/Animation/UIAccessProvider/IUIAccessProvider.cs @@ -1,7 +1,7 @@ using System; using System.Threading.Tasks; -namespace PCL.Core.UI.Animation.UIAccessProvider; +namespace PCL.CE.Core.UI.Animation.UIAccessProvider; /// /// 跨框架的 UI 线程访问接口。 diff --git a/PCL.Core/UI/Animation/UIAccessProvider/WpfUIAccessProvider.cs b/PCL.CE/Core/UI/Animation/UIAccessProvider/WpfUIAccessProvider.cs similarity index 96% rename from PCL.Core/UI/Animation/UIAccessProvider/WpfUIAccessProvider.cs rename to PCL.CE/Core/UI/Animation/UIAccessProvider/WpfUIAccessProvider.cs index 478df5b09..234cce5d5 100644 --- a/PCL.Core/UI/Animation/UIAccessProvider/WpfUIAccessProvider.cs +++ b/PCL.CE/Core/UI/Animation/UIAccessProvider/WpfUIAccessProvider.cs @@ -3,7 +3,7 @@ using System.Windows.Media; using System.Windows.Threading; -namespace PCL.Core.UI.Animation.UIAccessProvider; +namespace PCL.CE.Core.UI.Animation.UIAccessProvider; public sealed class WpfUIAccessProvider(Dispatcher dispatcher) : IUIAccessProvider { diff --git a/PCL.Core/UI/Animation/ValueProcessor/DoubleValueProcessor.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/DoubleValueProcessor.cs similarity index 87% rename from PCL.Core/UI/Animation/ValueProcessor/DoubleValueProcessor.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/DoubleValueProcessor.cs index 20ea409e3..6106b01d1 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/DoubleValueProcessor.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/DoubleValueProcessor.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; public class DoubleValueProcessor : IValueProcessor { diff --git a/PCL.Core/UI/Animation/ValueProcessor/IValueProcessor.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/IValueProcessor.cs similarity index 95% rename from PCL.Core/UI/Animation/ValueProcessor/IValueProcessor.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/IValueProcessor.cs index 6694c816f..494c82314 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/IValueProcessor.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/IValueProcessor.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; /// /// 数值处理器。 diff --git a/PCL.Core/UI/Animation/ValueProcessor/MatrixValueProcessor.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/MatrixValueProcessor.cs similarity index 95% rename from PCL.Core/UI/Animation/ValueProcessor/MatrixValueProcessor.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/MatrixValueProcessor.cs index 11edf954b..bfdf76c14 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/MatrixValueProcessor.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/MatrixValueProcessor.cs @@ -1,6 +1,6 @@ using System.Windows.Media; -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; public class MatrixValueProcessor : IValueProcessor { diff --git a/PCL.Core/UI/Animation/ValueProcessor/NColorValueProcessor.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/NColorValueProcessor.cs similarity index 90% rename from PCL.Core/UI/Animation/ValueProcessor/NColorValueProcessor.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/NColorValueProcessor.cs index 132804392..dce0c1e1a 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/NColorValueProcessor.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/NColorValueProcessor.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; public class NColorValueProcessor : IValueProcessor { diff --git a/PCL.Core/UI/Animation/ValueProcessor/PointValueProcessor.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/PointValueProcessor.cs similarity index 89% rename from PCL.Core/UI/Animation/ValueProcessor/PointValueProcessor.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/PointValueProcessor.cs index 8e2995354..d4f2b7789 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/PointValueProcessor.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/PointValueProcessor.cs @@ -1,6 +1,6 @@ using System.Windows; -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; public class PointValueProcessor : IValueProcessor { diff --git a/PCL.Core/UI/Animation/ValueProcessor/ThicknessValueProcessor.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/ThicknessValueProcessor.cs similarity index 94% rename from PCL.Core/UI/Animation/ValueProcessor/ThicknessValueProcessor.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/ThicknessValueProcessor.cs index 4f972420e..bbd46dc5f 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/ThicknessValueProcessor.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/ThicknessValueProcessor.cs @@ -1,6 +1,6 @@ using System.Windows; -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; public class ThicknessValueProcessor : IValueProcessor { diff --git a/PCL.Core/UI/Animation/ValueProcessor/ValueProcessorManager.cs b/PCL.CE/Core/UI/Animation/ValueProcessor/ValueProcessorManager.cs similarity index 96% rename from PCL.Core/UI/Animation/ValueProcessor/ValueProcessorManager.cs rename to PCL.CE/Core/UI/Animation/ValueProcessor/ValueProcessorManager.cs index 964fffd2e..33c0dfb40 100644 --- a/PCL.Core/UI/Animation/ValueProcessor/ValueProcessorManager.cs +++ b/PCL.CE/Core/UI/Animation/ValueProcessor/ValueProcessorManager.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PCL.Core.UI.Animation.ValueProcessor; +namespace PCL.CE.Core.UI.Animation.ValueProcessor; public static class ValueProcessorManager { diff --git a/PCL.Core/UI/Assets/Shaders/AdaptiveBlur.hlsl b/PCL.CE/Core/UI/Assets/Shaders/AdaptiveBlur.hlsl similarity index 100% rename from PCL.Core/UI/Assets/Shaders/AdaptiveBlur.hlsl rename to PCL.CE/Core/UI/Assets/Shaders/AdaptiveBlur.hlsl diff --git a/PCL.Core/UI/Assets/Shaders/AdaptiveBlur.ps b/PCL.CE/Core/UI/Assets/Shaders/AdaptiveBlur.ps similarity index 100% rename from PCL.Core/UI/Assets/Shaders/AdaptiveBlur.ps rename to PCL.CE/Core/UI/Assets/Shaders/AdaptiveBlur.ps diff --git a/PCL.Core/UI/Assets/Shaders/CompileShader.bat b/PCL.CE/Core/UI/Assets/Shaders/CompileShader.bat similarity index 100% rename from PCL.Core/UI/Assets/Shaders/CompileShader.bat rename to PCL.CE/Core/UI/Assets/Shaders/CompileShader.bat diff --git a/PCL.Core/UI/BackgroundPresenter.cs b/PCL.CE/Core/UI/BackgroundPresenter.cs similarity index 99% rename from PCL.Core/UI/BackgroundPresenter.cs rename to PCL.CE/Core/UI/BackgroundPresenter.cs index 729ca97ae..1aa0d4786 100644 --- a/PCL.Core/UI/BackgroundPresenter.cs +++ b/PCL.CE/Core/UI/BackgroundPresenter.cs @@ -10,7 +10,7 @@ // 作者: EleCho // 协议: MIT License -namespace PCL.Core.UI +namespace PCL.CE.Core.UI { /// /// Used for rendering the background content of a UIElement. By adding a to this element, you can achieve a blurred background effect. diff --git a/PCL.Core/UI/Controls/BlurBorder.cs b/PCL.CE/Core/UI/Controls/BlurBorder.cs similarity index 99% rename from PCL.Core/UI/Controls/BlurBorder.cs rename to PCL.CE/Core/UI/Controls/BlurBorder.cs index b3f36b05f..505f8f22d 100644 --- a/PCL.Core/UI/Controls/BlurBorder.cs +++ b/PCL.CE/Core/UI/Controls/BlurBorder.cs @@ -4,14 +4,14 @@ using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Effects; -using PCL.Core.UI.Effects; +using PCL.CE.Core.UI.Effects; // 该部分源码来自或修改于 https://github.com/OrgEleCho/EleCho.WpfSuite // 项目: EleCho.WpfSuite // 作者: EleCho // 协议: MIT License -namespace PCL.Core.UI.Controls; +namespace PCL.CE.Core.UI.Controls; // ReSharper disable All diff --git a/PCL.Core/UI/Controls/MotdRenderer.xaml b/PCL.CE/Core/UI/Controls/MotdRenderer.xaml similarity index 88% rename from PCL.Core/UI/Controls/MotdRenderer.xaml rename to PCL.CE/Core/UI/Controls/MotdRenderer.xaml index ac64f98d5..685510a73 100644 --- a/PCL.Core/UI/Controls/MotdRenderer.xaml +++ b/PCL.CE/Core/UI/Controls/MotdRenderer.xaml @@ -1,4 +1,4 @@ - /// 瀑布流布局模式 diff --git a/PCL.Core/UI/Converters/EasingConverter.cs b/PCL.CE/Core/UI/Converters/EasingConverter.cs similarity index 98% rename from PCL.Core/UI/Converters/EasingConverter.cs rename to PCL.CE/Core/UI/Converters/EasingConverter.cs index d5dc59839..0475d237e 100644 --- a/PCL.Core/UI/Converters/EasingConverter.cs +++ b/PCL.CE/Core/UI/Converters/EasingConverter.cs @@ -1,9 +1,9 @@ using System; using System.ComponentModel; using System.Globalization; -using PCL.Core.UI.Animation.Easings; +using PCL.CE.Core.UI.Animation.Easings; -namespace PCL.Core.UI.Converters; +namespace PCL.CE.Core.UI.Converters; public class EasingConverter : TypeConverter { diff --git a/PCL.Core/UI/Converters/NColorConverter.cs b/PCL.CE/Core/UI/Converters/NColorConverter.cs similarity index 96% rename from PCL.Core/UI/Converters/NColorConverter.cs rename to PCL.CE/Core/UI/Converters/NColorConverter.cs index 6837108f4..998ca6721 100644 --- a/PCL.Core/UI/Converters/NColorConverter.cs +++ b/PCL.CE/Core/UI/Converters/NColorConverter.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Globalization; -namespace PCL.Core.UI.Converters; +namespace PCL.CE.Core.UI.Converters; public class NColorConverter : TypeConverter { diff --git a/PCL.Core/UI/Converters/NullToVisibilityConverter.cs b/PCL.CE/Core/UI/Converters/NullToVisibilityConverter.cs similarity index 94% rename from PCL.Core/UI/Converters/NullToVisibilityConverter.cs rename to PCL.CE/Core/UI/Converters/NullToVisibilityConverter.cs index 08811e532..665206d45 100644 --- a/PCL.Core/UI/Converters/NullToVisibilityConverter.cs +++ b/PCL.CE/Core/UI/Converters/NullToVisibilityConverter.cs @@ -3,7 +3,7 @@ using System.Windows; using System.Windows.Data; -namespace PCL.Core.UI.Converters; +namespace PCL.CE.Core.UI.Converters; /// /// 将可 null 的值转换为 WPF Visibility 状态:若为 null 则折叠,否则可见 diff --git a/PCL.Core/UI/Effects/AdaptiveBlurEffect.cs b/PCL.CE/Core/UI/Effects/AdaptiveBlurEffect.cs similarity index 99% rename from PCL.Core/UI/Effects/AdaptiveBlurEffect.cs rename to PCL.CE/Core/UI/Effects/AdaptiveBlurEffect.cs index cc40d2672..4d11c3f83 100644 --- a/PCL.Core/UI/Effects/AdaptiveBlurEffect.cs +++ b/PCL.CE/Core/UI/Effects/AdaptiveBlurEffect.cs @@ -6,7 +6,7 @@ using System.Windows.Media; using System.Windows.Media.Effects; -namespace PCL.Core.UI.Effects; +namespace PCL.CE.Core.UI.Effects; // ReSharper disable UnusedMember.Local, UnusedParameter.Local /// @@ -15,7 +15,7 @@ namespace PCL.Core.UI.Effects; /// public sealed class AdaptiveBlurEffect : ShaderEffect { - private const string PixelShaderUri = "pack://application:,,,/PCL.Core;component/UI/Assets/Shaders/AdaptiveBlur.ps"; + private const string PixelShaderUri = "pack://application:,,,/PCL.CE.Core;component/UI/Assets/Shaders/AdaptiveBlur.ps"; private static readonly MemoryPool _MemoryPool = MemoryPool.Shared; private static readonly object _ShaderLock = new(); diff --git a/PCL.Core/UI/Effects/EnhancedBlurEffect.cs b/PCL.CE/Core/UI/Effects/EnhancedBlurEffect.cs similarity index 99% rename from PCL.Core/UI/Effects/EnhancedBlurEffect.cs rename to PCL.CE/Core/UI/Effects/EnhancedBlurEffect.cs index ce0d5c946..b84ec2aed 100644 --- a/PCL.Core/UI/Effects/EnhancedBlurEffect.cs +++ b/PCL.CE/Core/UI/Effects/EnhancedBlurEffect.cs @@ -3,7 +3,7 @@ using System.Windows; using System.Windows.Media.Effects; -namespace PCL.Core.UI.Effects; +namespace PCL.CE.Core.UI.Effects; /// /// 高性能模糊效果,基于智能采样算法实现显著性能提升 diff --git a/PCL.Core/UI/Effects/OptimizedBlurEffect.cs b/PCL.CE/Core/UI/Effects/OptimizedBlurEffect.cs similarity index 99% rename from PCL.Core/UI/Effects/OptimizedBlurEffect.cs rename to PCL.CE/Core/UI/Effects/OptimizedBlurEffect.cs index bcbd58c70..5ad76ef1c 100644 --- a/PCL.Core/UI/Effects/OptimizedBlurEffect.cs +++ b/PCL.CE/Core/UI/Effects/OptimizedBlurEffect.cs @@ -5,7 +5,7 @@ using System.Windows.Media.Effects; using System.Windows.Media.Imaging; -namespace PCL.Core.UI.Effects; +namespace PCL.CE.Core.UI.Effects; /// /// CPU优化的高性能模糊效果,支持精确的采样深度控制 diff --git a/PCL.Core/UI/Effects/SamplingBlurProcessor.cs b/PCL.CE/Core/UI/Effects/SamplingBlurProcessor.cs similarity index 99% rename from PCL.Core/UI/Effects/SamplingBlurProcessor.cs rename to PCL.CE/Core/UI/Effects/SamplingBlurProcessor.cs index 139d9b66b..4e1be5dac 100644 --- a/PCL.Core/UI/Effects/SamplingBlurProcessor.cs +++ b/PCL.CE/Core/UI/Effects/SamplingBlurProcessor.cs @@ -10,7 +10,7 @@ using System.Windows.Media.Effects; using System.Windows.Media.Imaging; -namespace PCL.Core.UI.Effects; +namespace PCL.CE.Core.UI.Effects; // ReSharper disable UnusedMember.Local, NotAccessedField.Local, UnusedParameter.Local, UnusedVariable /// diff --git a/PCL.Core/UI/GrayProfile.cs b/PCL.CE/Core/UI/GrayProfile.cs similarity index 98% rename from PCL.Core/UI/GrayProfile.cs rename to PCL.CE/Core/UI/GrayProfile.cs index 09625eb7e..e59f278f3 100644 --- a/PCL.Core/UI/GrayProfile.cs +++ b/PCL.CE/Core/UI/GrayProfile.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; [JsonSerializable(typeof(GrayProfile))] public record GrayProfile diff --git a/PCL.Core/UI/GrayProfileConfig.cs b/PCL.CE/Core/UI/GrayProfileConfig.cs similarity index 97% rename from PCL.Core/UI/GrayProfileConfig.cs rename to PCL.CE/Core/UI/GrayProfileConfig.cs index 9a158f938..40b52bb59 100644 --- a/PCL.Core/UI/GrayProfileConfig.cs +++ b/PCL.CE/Core/UI/GrayProfileConfig.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; [JsonSerializable(typeof(GrayProfileConfig))] public record GrayProfileConfig diff --git a/PCL.Core/UI/HintWrapper.cs b/PCL.CE/Core/UI/HintWrapper.cs similarity index 92% rename from PCL.Core/UI/HintWrapper.cs rename to PCL.CE/Core/UI/HintWrapper.cs index 674a70db0..8ed4c8fd4 100644 --- a/PCL.Core/UI/HintWrapper.cs +++ b/PCL.CE/Core/UI/HintWrapper.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; public enum HintTheme { diff --git a/PCL.Core/UI/IconManager.cs b/PCL.CE/Core/UI/IconManager.cs similarity index 98% rename from PCL.Core/UI/IconManager.cs rename to PCL.CE/Core/UI/IconManager.cs index 3134ef676..d6be08c8c 100644 --- a/PCL.Core/UI/IconManager.cs +++ b/PCL.CE/Core/UI/IconManager.cs @@ -4,7 +4,7 @@ using System.Windows; using System.Windows.Markup; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; // 图标管理器(处理集合和选择逻辑) public class IconManager : INotifyPropertyChanged { diff --git a/PCL.Core/UI/IconModel.cs b/PCL.CE/Core/UI/IconModel.cs similarity index 77% rename from PCL.Core/UI/IconModel.cs rename to PCL.CE/Core/UI/IconModel.cs index 92ffc3516..5665c8e63 100644 --- a/PCL.Core/UI/IconModel.cs +++ b/PCL.CE/Core/UI/IconModel.cs @@ -1,5 +1,5 @@ using System.Windows; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; public record IconModel(string Name, UIElement? XamlContent); diff --git a/PCL.Core/UI/ImageLoaderHelper.cs b/PCL.CE/Core/UI/ImageLoaderHelper.cs similarity index 99% rename from PCL.Core/UI/ImageLoaderHelper.cs rename to PCL.CE/Core/UI/ImageLoaderHelper.cs index 3c97582f8..ed77f6fdc 100644 --- a/PCL.Core/UI/ImageLoaderHelper.cs +++ b/PCL.CE/Core/UI/ImageLoaderHelper.cs @@ -4,7 +4,7 @@ using System.Windows.Controls; using System.Windows.Media.Imaging; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; /// /// 图像加载帮助类,提供通用的图像加载功能 diff --git a/PCL.Core/UI/Media/ImageConverter.cs b/PCL.CE/Core/UI/Media/ImageConverter.cs similarity index 98% rename from PCL.Core/UI/Media/ImageConverter.cs rename to PCL.CE/Core/UI/Media/ImageConverter.cs index eeaf9a62f..0a50c79b7 100644 --- a/PCL.Core/UI/Media/ImageConverter.cs +++ b/PCL.CE/Core/UI/Media/ImageConverter.cs @@ -2,7 +2,7 @@ using System.IO; using System.Windows.Media.Imaging; -namespace PCL.Core.UI.Media; +namespace PCL.CE.Core.UI.Media; public static class ImageConverter { diff --git a/PCL.Core/UI/MsgBoxWrapper.cs b/PCL.CE/Core/UI/MsgBoxWrapper.cs similarity index 98% rename from PCL.Core/UI/MsgBoxWrapper.cs rename to PCL.CE/Core/UI/MsgBoxWrapper.cs index 646deec87..edfe5cf9b 100644 --- a/PCL.Core/UI/MsgBoxWrapper.cs +++ b/PCL.CE/Core/UI/MsgBoxWrapper.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; public record MsgBoxButtonInfo( string Context, diff --git a/PCL.Core/UI/NColor.cs b/PCL.CE/Core/UI/NColor.cs similarity index 99% rename from PCL.Core/UI/NColor.cs rename to PCL.CE/Core/UI/NColor.cs index ccb73c33f..7b26ce773 100644 --- a/PCL.Core/UI/NColor.cs +++ b/PCL.CE/Core/UI/NColor.cs @@ -2,7 +2,7 @@ using System.Numerics; using System.Windows.Media; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; // TODO: 内部实现更换成 scRGB 并且增加更多的 From 与 To 方法 // TODO: 实现 IParsable / ISpanParsable 接口 diff --git a/PCL.Core/UI/SystemDialogs.cs b/PCL.CE/Core/UI/SystemDialogs.cs similarity index 99% rename from PCL.Core/UI/SystemDialogs.cs rename to PCL.CE/Core/UI/SystemDialogs.cs index 2ac446ae4..02eb97ed7 100644 --- a/PCL.Core/UI/SystemDialogs.cs +++ b/PCL.CE/Core/UI/SystemDialogs.cs @@ -1,7 +1,7 @@ using Microsoft.Win32; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; using System; using System.IO; diff --git a/PCL.Core/UI/Theme/CatColorResource.cs b/PCL.CE/Core/UI/Theme/CatColorResource.cs similarity index 94% rename from PCL.Core/UI/Theme/CatColorResource.cs rename to PCL.CE/Core/UI/Theme/CatColorResource.cs index 4b4c45cde..1a9480a59 100644 --- a/PCL.Core/UI/Theme/CatColorResource.cs +++ b/PCL.CE/Core/UI/Theme/CatColorResource.cs @@ -1,8 +1,8 @@ using System.Windows.Media; -using PCL.Core.App; -using PCL.Core.App.IoC; +using PCL.CE.Core.App; +using PCL.CE.Core.App.IoC; -namespace PCL.Core.UI.Theme; +namespace PCL.CE.Core.UI.Theme; public class CatColorResource { diff --git a/PCL.Core/UI/Theme/LabColor.cs b/PCL.CE/Core/UI/Theme/LabColor.cs similarity index 99% rename from PCL.Core/UI/Theme/LabColor.cs rename to PCL.CE/Core/UI/Theme/LabColor.cs index fdce0fb2d..5e91583b5 100644 --- a/PCL.Core/UI/Theme/LabColor.cs +++ b/PCL.CE/Core/UI/Theme/LabColor.cs @@ -1,7 +1,7 @@ using System; using Wacton.Unicolour; -namespace PCL.Core.UI.Theme; +namespace PCL.CE.Core.UI.Theme; /// /// Color definition, cast and other utilities based on OKLAB color space. diff --git a/PCL.Core/UI/Theme/SystemThemeHelper.cs b/PCL.CE/Core/UI/Theme/SystemThemeHelper.cs similarity index 94% rename from PCL.Core/UI/Theme/SystemThemeHelper.cs rename to PCL.CE/Core/UI/Theme/SystemThemeHelper.cs index 471f4fa88..25aafb328 100644 --- a/PCL.Core/UI/Theme/SystemThemeHelper.cs +++ b/PCL.CE/Core/UI/Theme/SystemThemeHelper.cs @@ -2,10 +2,10 @@ using System.IO; using System.Security; using Microsoft.Win32; -using PCL.Core.App; -using PCL.Core.Logging; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; -namespace PCL.Core.UI.Theme; +namespace PCL.CE.Core.UI.Theme; public static class SystemThemeHelper { private const string ThemeRegistryPath = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; diff --git a/PCL.Core/UI/Theme/ThemeService.cs b/PCL.CE/Core/UI/Theme/ThemeService.cs similarity index 98% rename from PCL.Core/UI/Theme/ThemeService.cs rename to PCL.CE/Core/UI/Theme/ThemeService.cs index c497863c8..4cc714c1c 100644 --- a/PCL.Core/UI/Theme/ThemeService.cs +++ b/PCL.CE/Core/UI/Theme/ThemeService.cs @@ -1,9 +1,9 @@ using System; -using PCL.Core.App; -using PCL.Core.App.Configuration; -using PCL.Core.App.IoC; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Configuration; +using PCL.CE.Core.App.IoC; -namespace PCL.Core.UI.Theme; +namespace PCL.CE.Core.UI.Theme; /// /// 配色模式更改事件。 diff --git a/PCL.Core/UI/Theme/ToneProfile.cs b/PCL.CE/Core/UI/Theme/ToneProfile.cs similarity index 95% rename from PCL.Core/UI/Theme/ToneProfile.cs rename to PCL.CE/Core/UI/Theme/ToneProfile.cs index 578cb5e66..7afb4a2bc 100644 --- a/PCL.Core/UI/Theme/ToneProfile.cs +++ b/PCL.CE/Core/UI/Theme/ToneProfile.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Theme; +namespace PCL.CE.Core.UI.Theme; public record ToneProfile( double L1 = 0.35, diff --git a/PCL.Core/UI/Theme/ToneProfileConfig.cs b/PCL.CE/Core/UI/Theme/ToneProfileConfig.cs similarity index 93% rename from PCL.Core/UI/Theme/ToneProfileConfig.cs rename to PCL.CE/Core/UI/Theme/ToneProfileConfig.cs index 90f1e24fb..074f29989 100644 --- a/PCL.Core/UI/Theme/ToneProfileConfig.cs +++ b/PCL.CE/Core/UI/Theme/ToneProfileConfig.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI.Theme; +namespace PCL.CE.Core.UI.Theme; public record ToneProfileConfig { diff --git a/PCL.Core/UI/ToastNotification.cs b/PCL.CE/Core/UI/ToastNotification.cs similarity index 96% rename from PCL.Core/UI/ToastNotification.cs rename to PCL.CE/Core/UI/ToastNotification.cs index d46936ddd..b603b14b4 100644 --- a/PCL.Core/UI/ToastNotification.cs +++ b/PCL.CE/Core/UI/ToastNotification.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.UI; +namespace PCL.CE.Core.UI; public static class ToastNotification { diff --git a/PCL.Core/Utils/ArgumentsBuilder.cs b/PCL.CE/Core/Utils/ArgumentsBuilder.cs similarity index 99% rename from PCL.Core/Utils/ArgumentsBuilder.cs rename to PCL.CE/Core/Utils/ArgumentsBuilder.cs index b8383151c..be5d5ff06 100644 --- a/PCL.Core/Utils/ArgumentsBuilder.cs +++ b/PCL.CE/Core/Utils/ArgumentsBuilder.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Text; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public class ArgumentsBuilder { diff --git a/PCL.Core/Utils/AtomicVariable.cs b/PCL.CE/Core/Utils/AtomicVariable.cs similarity index 96% rename from PCL.Core/Utils/AtomicVariable.cs rename to PCL.CE/Core/Utils/AtomicVariable.cs index 14ee5e3f1..29c104731 100644 --- a/PCL.Core/Utils/AtomicVariable.cs +++ b/PCL.CE/Core/Utils/AtomicVariable.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public sealed class AtomicVariable { diff --git a/PCL.Core/Utils/Codecs/EncodingDetector.cs b/PCL.CE/Core/Utils/Codecs/EncodingDetector.cs similarity index 98% rename from PCL.Core/Utils/Codecs/EncodingDetector.cs rename to PCL.CE/Core/Utils/Codecs/EncodingDetector.cs index e57e62f06..279b8c357 100644 --- a/PCL.Core/Utils/Codecs/EncodingDetector.cs +++ b/PCL.CE/Core/Utils/Codecs/EncodingDetector.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Text; -namespace PCL.Core.Utils.Codecs; +namespace PCL.CE.Core.Utils.Codecs; public static class EncodingDetector { diff --git a/PCL.Core/Utils/Codecs/EncodingUtils.cs b/PCL.CE/Core/Utils/Codecs/EncodingUtils.cs similarity index 98% rename from PCL.Core/Utils/Codecs/EncodingUtils.cs rename to PCL.CE/Core/Utils/Codecs/EncodingUtils.cs index 0c6e35c7a..d6da5fe9a 100644 --- a/PCL.Core/Utils/Codecs/EncodingUtils.cs +++ b/PCL.CE/Core/Utils/Codecs/EncodingUtils.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils.Codecs; +namespace PCL.CE.Core.Utils.Codecs; using System; using System.Text; diff --git a/PCL.Core/Utils/Codecs/Encodings.cs b/PCL.CE/Core/Utils/Codecs/Encodings.cs similarity index 79% rename from PCL.Core/Utils/Codecs/Encodings.cs rename to PCL.CE/Core/Utils/Codecs/Encodings.cs index e4e0aca30..83c75dbc0 100644 --- a/PCL.Core/Utils/Codecs/Encodings.cs +++ b/PCL.CE/Core/Utils/Codecs/Encodings.cs @@ -1,6 +1,6 @@ using System.Text; -namespace PCL.Core.Utils.Codecs; +namespace PCL.CE.Core.Utils.Codecs; public static class Encodings { public static readonly Encoding GB18030 = Encoding.GetEncoding("GB18030"); diff --git a/PCL.Core/Utils/ConcurrentSet.cs b/PCL.CE/Core/Utils/ConcurrentSet.cs similarity index 98% rename from PCL.Core/Utils/ConcurrentSet.cs rename to PCL.CE/Core/Utils/ConcurrentSet.cs index d95af685f..4fd6e3ea4 100644 --- a/PCL.Core/Utils/ConcurrentSet.cs +++ b/PCL.CE/Core/Utils/ConcurrentSet.cs @@ -5,7 +5,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public sealed class ConcurrentSet : IProducerConsumerCollection, ICollection where T: notnull { diff --git a/PCL.Core/Utils/Diagnostics/StackHelper.cs b/PCL.CE/Core/Utils/Diagnostics/StackHelper.cs similarity index 99% rename from PCL.Core/Utils/Diagnostics/StackHelper.cs rename to PCL.CE/Core/Utils/Diagnostics/StackHelper.cs index ccb5113d5..217146679 100644 --- a/PCL.Core/Utils/Diagnostics/StackHelper.cs +++ b/PCL.CE/Core/Utils/Diagnostics/StackHelper.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; using System.Text; -namespace PCL.Core.Utils.Diagnostics; +namespace PCL.CE.Core.Utils.Diagnostics; public static class StackHelper { diff --git a/PCL.Core/Utils/Diff/BsDiff.cs b/PCL.CE/Core/Utils/Diff/BsDiff.cs similarity index 99% rename from PCL.Core/Utils/Diff/BsDiff.cs rename to PCL.CE/Core/Utils/Diff/BsDiff.cs index 968773d26..9c7aec8b2 100644 --- a/PCL.Core/Utils/Diff/BsDiff.cs +++ b/PCL.CE/Core/Utils/Diff/BsDiff.cs @@ -52,7 +52,7 @@ POSSIBILITY OF SUCH DAMAGE. using System.Threading.Tasks; using ICSharpCode.SharpZipLib.BZip2; -namespace PCL.Core.Utils.Diff; +namespace PCL.CE.Core.Utils.Diff; public class BsDiff : IBinaryDiff diff --git a/PCL.Core/Utils/Diff/IBinaryDiff.cs b/PCL.CE/Core/Utils/Diff/IBinaryDiff.cs similarity index 86% rename from PCL.Core/Utils/Diff/IBinaryDiff.cs rename to PCL.CE/Core/Utils/Diff/IBinaryDiff.cs index 65693395d..d898778d1 100644 --- a/PCL.Core/Utils/Diff/IBinaryDiff.cs +++ b/PCL.CE/Core/Utils/Diff/IBinaryDiff.cs @@ -1,6 +1,6 @@ using System.Threading.Tasks; -namespace PCL.Core.Utils.Diff; +namespace PCL.CE.Core.Utils.Diff; public interface IBinaryDiff { diff --git a/PCL.Core/Utils/Diff/ItemDiff.cs b/PCL.CE/Core/Utils/Diff/ItemDiff.cs similarity index 97% rename from PCL.Core/Utils/Diff/ItemDiff.cs rename to PCL.CE/Core/Utils/Diff/ItemDiff.cs index 0a7021d92..06ae2e823 100644 --- a/PCL.Core/Utils/Diff/ItemDiff.cs +++ b/PCL.CE/Core/Utils/Diff/ItemDiff.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace PCL.Core.Utils.Diff +namespace PCL.CE.Core.Utils.Diff { public class ItemDiff { diff --git a/PCL.Core/Utils/Diff/ItemDiffResult.cs b/PCL.CE/Core/Utils/Diff/ItemDiffResult.cs similarity index 95% rename from PCL.Core/Utils/Diff/ItemDiffResult.cs rename to PCL.CE/Core/Utils/Diff/ItemDiffResult.cs index 0f53542f1..acdd46273 100644 --- a/PCL.Core/Utils/Diff/ItemDiffResult.cs +++ b/PCL.CE/Core/Utils/Diff/ItemDiffResult.cs @@ -4,7 +4,7 @@ using System.Text; using System.Threading.Tasks; -namespace PCL.Core.Utils.Diff +namespace PCL.CE.Core.Utils.Diff { public class ItemDiffResult { diff --git a/PCL.Core/Utils/EaseUtils.cs b/PCL.CE/Core/Utils/EaseUtils.cs similarity index 97% rename from PCL.Core/Utils/EaseUtils.cs rename to PCL.CE/Core/Utils/EaseUtils.cs index 1ad361403..e51d32acb 100644 --- a/PCL.Core/Utils/EaseUtils.cs +++ b/PCL.CE/Core/Utils/EaseUtils.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; internal static class EaseUtils { diff --git a/PCL.Core/Utils/Encryption/AesCbcProvider.cs b/PCL.CE/Core/Utils/Encryption/AesCbcProvider.cs similarity index 97% rename from PCL.Core/Utils/Encryption/AesCbcProvider.cs rename to PCL.CE/Core/Utils/Encryption/AesCbcProvider.cs index 987c7f040..142906634 100644 --- a/PCL.Core/Utils/Encryption/AesCbcProvider.cs +++ b/PCL.CE/Core/Utils/Encryption/AesCbcProvider.cs @@ -2,7 +2,7 @@ using System.IO; using System.Security.Cryptography; -namespace PCL.Core.Utils.Encryption +namespace PCL.CE.Core.Utils.Encryption { [Obsolete("Do not use this AES mode for Encryption")] public sealed class AesCbcProvider : IEncryptionProvider diff --git a/PCL.Core/Utils/Encryption/AesGcmProvider.cs b/PCL.CE/Core/Utils/Encryption/AesGcmProvider.cs similarity index 97% rename from PCL.Core/Utils/Encryption/AesGcmProvider.cs rename to PCL.CE/Core/Utils/Encryption/AesGcmProvider.cs index 5bd7578c7..db3701bfb 100644 --- a/PCL.Core/Utils/Encryption/AesGcmProvider.cs +++ b/PCL.CE/Core/Utils/Encryption/AesGcmProvider.cs @@ -1,7 +1,7 @@ using System; using System.Security.Cryptography; -namespace PCL.Core.Utils.Encryption +namespace PCL.CE.Core.Utils.Encryption { public class AesGcmProvider : IEncryptionProvider { diff --git a/PCL.Core/Utils/Encryption/ChaCha20Poly1305Provider.cs b/PCL.CE/Core/Utils/Encryption/ChaCha20Poly1305Provider.cs similarity index 95% rename from PCL.Core/Utils/Encryption/ChaCha20Poly1305Provider.cs rename to PCL.CE/Core/Utils/Encryption/ChaCha20Poly1305Provider.cs index 74ba8751d..4306722ed 100644 --- a/PCL.Core/Utils/Encryption/ChaCha20Poly1305Provider.cs +++ b/PCL.CE/Core/Utils/Encryption/ChaCha20Poly1305Provider.cs @@ -1,7 +1,7 @@ using System; using System.Security.Cryptography; -namespace PCL.Core.Utils.Encryption; +namespace PCL.CE.Core.Utils.Encryption; public sealed class ChaCha20Poly1305Provider : IEncryptionProvider { @@ -69,7 +69,7 @@ public byte[] Decrypt(ReadOnlySpan data, ReadOnlySpan key) return plaintext; } - private static readonly byte[] _Info = "PCL.Core.Utils.Encryption.ChaCha20"u8.ToArray(); + private static readonly byte[] _Info = "PCL.CE.Core.Utils.Encryption.ChaCha20"u8.ToArray(); private static void _DeriveKey(ReadOnlySpan ikm, ReadOnlySpan salt, Span outputKey) { HKDF.DeriveKey( diff --git a/PCL.Core/Utils/Encryption/ChaCha20SoftwareProvider.cs b/PCL.CE/Core/Utils/Encryption/ChaCha20SoftwareProvider.cs similarity index 99% rename from PCL.Core/Utils/Encryption/ChaCha20SoftwareProvider.cs rename to PCL.CE/Core/Utils/Encryption/ChaCha20SoftwareProvider.cs index e238d8bce..a209056b0 100644 --- a/PCL.Core/Utils/Encryption/ChaCha20SoftwareProvider.cs +++ b/PCL.CE/Core/Utils/Encryption/ChaCha20SoftwareProvider.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Security.Cryptography; -namespace PCL.Core.Utils.Encryption; +namespace PCL.CE.Core.Utils.Encryption; public class ChaCha20SoftwareProvider : IEncryptionProvider { diff --git a/PCL.Core/Utils/Encryption/IEncryptionProvider.cs b/PCL.CE/Core/Utils/Encryption/IEncryptionProvider.cs similarity index 86% rename from PCL.Core/Utils/Encryption/IEncryptionProvider.cs rename to PCL.CE/Core/Utils/Encryption/IEncryptionProvider.cs index 5084f95b9..3f1fecd9d 100644 --- a/PCL.Core/Utils/Encryption/IEncryptionProvider.cs +++ b/PCL.CE/Core/Utils/Encryption/IEncryptionProvider.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Utils.Encryption; +namespace PCL.CE.Core.Utils.Encryption; public interface IEncryptionProvider { diff --git a/PCL.Core/Utils/ExpandoObjectConverter.cs b/PCL.CE/Core/Utils/ExpandoObjectConverter.cs similarity index 98% rename from PCL.Core/Utils/ExpandoObjectConverter.cs rename to PCL.CE/Core/Utils/ExpandoObjectConverter.cs index 2d1197844..f6d894c37 100644 --- a/PCL.Core/Utils/ExpandoObjectConverter.cs +++ b/PCL.CE/Core/Utils/ExpandoObjectConverter.cs @@ -4,7 +4,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; // Partly generated by o4-mini (20250611) // ReSharper disable All diff --git a/PCL.Core/Utils/Exts/AsyncEnumerableExtensions.cs b/PCL.CE/Core/Utils/Exts/AsyncEnumerableExtensions.cs similarity index 99% rename from PCL.Core/Utils/Exts/AsyncEnumerableExtensions.cs rename to PCL.CE/Core/Utils/Exts/AsyncEnumerableExtensions.cs index b558b0a20..a5d31e279 100644 --- a/PCL.Core/Utils/Exts/AsyncEnumerableExtensions.cs +++ b/PCL.CE/Core/Utils/Exts/AsyncEnumerableExtensions.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class AsyncEnumerableExtensions { diff --git a/PCL.Core/Utils/Exts/ByteExtension.cs b/PCL.CE/Core/Utils/Exts/ByteExtension.cs similarity index 91% rename from PCL.Core/Utils/Exts/ByteExtension.cs rename to PCL.CE/Core/Utils/Exts/ByteExtension.cs index 2c51ce3c2..e716c3c85 100644 --- a/PCL.Core/Utils/Exts/ByteExtension.cs +++ b/PCL.CE/Core/Utils/Exts/ByteExtension.cs @@ -1,7 +1,7 @@ using System; using System.Text; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class ByteExtension { diff --git a/PCL.Core/Utils/Exts/ConcurrentDictionaryExtension.cs b/PCL.CE/Core/Utils/Exts/ConcurrentDictionaryExtension.cs similarity index 96% rename from PCL.Core/Utils/Exts/ConcurrentDictionaryExtension.cs rename to PCL.CE/Core/Utils/Exts/ConcurrentDictionaryExtension.cs index b83067082..73122a21c 100644 --- a/PCL.Core/Utils/Exts/ConcurrentDictionaryExtension.cs +++ b/PCL.CE/Core/Utils/Exts/ConcurrentDictionaryExtension.cs @@ -1,7 +1,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class ConcurrentDictionaryExtension { diff --git a/PCL.Core/Utils/Exts/HttpRequestExtension.cs b/PCL.CE/Core/Utils/Exts/HttpRequestExtension.cs similarity index 97% rename from PCL.Core/Utils/Exts/HttpRequestExtension.cs rename to PCL.CE/Core/Utils/Exts/HttpRequestExtension.cs index a94501fcf..2b67fd27b 100644 --- a/PCL.Core/Utils/Exts/HttpRequestExtension.cs +++ b/PCL.CE/Core/Utils/Exts/HttpRequestExtension.cs @@ -4,7 +4,7 @@ using System.Net.Http; using System.Threading.Tasks; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class HttpRequestExtension { diff --git a/PCL.Core/Utils/Exts/LanguageSpecificStringDictionaryExtensions.cs b/PCL.CE/Core/Utils/Exts/LanguageSpecificStringDictionaryExtensions.cs similarity index 97% rename from PCL.Core/Utils/Exts/LanguageSpecificStringDictionaryExtensions.cs rename to PCL.CE/Core/Utils/Exts/LanguageSpecificStringDictionaryExtensions.cs index 74c92cc62..5f6eb0569 100644 --- a/PCL.Core/Utils/Exts/LanguageSpecificStringDictionaryExtensions.cs +++ b/PCL.CE/Core/Utils/Exts/LanguageSpecificStringDictionaryExtensions.cs @@ -3,7 +3,7 @@ using System.Windows.Markup; using System.Windows.Media; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class LanguageSpecificStringDictionaryExtensions { diff --git a/PCL.Core/Utils/Exts/ListExtension.cs b/PCL.CE/Core/Utils/Exts/ListExtension.cs similarity index 98% rename from PCL.Core/Utils/Exts/ListExtension.cs rename to PCL.CE/Core/Utils/Exts/ListExtension.cs index 21668682c..21126fde4 100644 --- a/PCL.Core/Utils/Exts/ListExtension.cs +++ b/PCL.CE/Core/Utils/Exts/ListExtension.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class ListUtils { diff --git a/PCL.Core/Utils/Exts/StringExtension.cs b/PCL.CE/Core/Utils/Exts/StringExtension.cs similarity index 99% rename from PCL.Core/Utils/Exts/StringExtension.cs rename to PCL.CE/Core/Utils/Exts/StringExtension.cs index 722729bb6..9274d04c7 100644 --- a/PCL.Core/Utils/Exts/StringExtension.cs +++ b/PCL.CE/Core/Utils/Exts/StringExtension.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; using System.Text.RegularExpressions; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class StringConvertExtension { diff --git a/PCL.Core/Utils/Exts/TaskExtension.cs b/PCL.CE/Core/Utils/Exts/TaskExtension.cs similarity index 98% rename from PCL.Core/Utils/Exts/TaskExtension.cs rename to PCL.CE/Core/Utils/Exts/TaskExtension.cs index 0bca83f77..759ebb95c 100644 --- a/PCL.Core/Utils/Exts/TaskExtension.cs +++ b/PCL.CE/Core/Utils/Exts/TaskExtension.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Threading.Tasks; -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; public static class TaskExtensions { /// diff --git a/PCL.Core/Utils/Exts/UiExtension.cs b/PCL.CE/Core/Utils/Exts/UiExtension.cs similarity index 98% rename from PCL.Core/Utils/Exts/UiExtension.cs rename to PCL.CE/Core/Utils/Exts/UiExtension.cs index 148837b6c..3310c6377 100644 --- a/PCL.Core/Utils/Exts/UiExtension.cs +++ b/PCL.CE/Core/Utils/Exts/UiExtension.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils.Exts; +namespace PCL.CE.Core.Utils.Exts; using System; using System.Windows; diff --git a/PCL.Core/Utils/FrameUtils.cs b/PCL.CE/Core/Utils/FrameUtils.cs similarity index 98% rename from PCL.Core/Utils/FrameUtils.cs rename to PCL.CE/Core/Utils/FrameUtils.cs index 98206e51d..61f2277bb 100644 --- a/PCL.Core/Utils/FrameUtils.cs +++ b/PCL.CE/Core/Utils/FrameUtils.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; /// /// 帮助动画帧的工具类。 diff --git a/PCL.Core/Utils/Hash/IHashProvider.cs b/PCL.CE/Core/Utils/Hash/IHashProvider.cs similarity index 92% rename from PCL.Core/Utils/Hash/IHashProvider.cs rename to PCL.CE/Core/Utils/Hash/IHashProvider.cs index 72260fe46..2f6b6a4ab 100644 --- a/PCL.Core/Utils/Hash/IHashProvider.cs +++ b/PCL.CE/Core/Utils/Hash/IHashProvider.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Hash; +namespace PCL.CE.Core.Utils.Hash; public interface IHashProvider { diff --git a/PCL.Core/Utils/Hash/MD5Provider.cs b/PCL.CE/Core/Utils/Hash/MD5Provider.cs similarity index 96% rename from PCL.Core/Utils/Hash/MD5Provider.cs rename to PCL.CE/Core/Utils/Hash/MD5Provider.cs index 1a8b511d2..fc3e328b8 100644 --- a/PCL.Core/Utils/Hash/MD5Provider.cs +++ b/PCL.CE/Core/Utils/Hash/MD5Provider.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Hash; +namespace PCL.CE.Core.Utils.Hash; public class MD5Provider : IHashProvider { public static MD5Provider Instance { get; } = new(); diff --git a/PCL.Core/Utils/Hash/SHA1Provider.cs b/PCL.CE/Core/Utils/Hash/SHA1Provider.cs similarity index 96% rename from PCL.Core/Utils/Hash/SHA1Provider.cs rename to PCL.CE/Core/Utils/Hash/SHA1Provider.cs index e3f4fa748..541f5d007 100644 --- a/PCL.Core/Utils/Hash/SHA1Provider.cs +++ b/PCL.CE/Core/Utils/Hash/SHA1Provider.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Hash; +namespace PCL.CE.Core.Utils.Hash; public class SHA1Provider : IHashProvider { diff --git a/PCL.Core/Utils/Hash/SHA256Provider.cs b/PCL.CE/Core/Utils/Hash/SHA256Provider.cs similarity index 96% rename from PCL.Core/Utils/Hash/SHA256Provider.cs rename to PCL.CE/Core/Utils/Hash/SHA256Provider.cs index 4edd6bfc2..fb9cfd5cb 100644 --- a/PCL.Core/Utils/Hash/SHA256Provider.cs +++ b/PCL.CE/Core/Utils/Hash/SHA256Provider.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Hash; +namespace PCL.CE.Core.Utils.Hash; public class SHA256Provider : IHashProvider { diff --git a/PCL.Core/Utils/Hash/SHA512Provider.cs b/PCL.CE/Core/Utils/Hash/SHA512Provider.cs similarity index 96% rename from PCL.Core/Utils/Hash/SHA512Provider.cs rename to PCL.CE/Core/Utils/Hash/SHA512Provider.cs index 65c749ced..a9eee6b72 100644 --- a/PCL.Core/Utils/Hash/SHA512Provider.cs +++ b/PCL.CE/Core/Utils/Hash/SHA512Provider.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Hash; +namespace PCL.CE.Core.Utils.Hash; public class SHA512Provider : IHashProvider { diff --git a/PCL.Core/Utils/OS/ClipboardUtils.cs b/PCL.CE/Core/Utils/OS/ClipboardUtils.cs similarity index 95% rename from PCL.Core/Utils/OS/ClipboardUtils.cs rename to PCL.CE/Core/Utils/OS/ClipboardUtils.cs index fef7a8028..88e13a5c7 100644 --- a/PCL.Core/Utils/OS/ClipboardUtils.cs +++ b/PCL.CE/Core/Utils/OS/ClipboardUtils.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; using System; using System.Windows; diff --git a/PCL.Core/Utils/OS/DragHelper.cs b/PCL.CE/Core/Utils/OS/DragHelper.cs similarity index 95% rename from PCL.Core/Utils/OS/DragHelper.cs rename to PCL.CE/Core/Utils/OS/DragHelper.cs index 115d1332a..f8c53dd50 100644 --- a/PCL.Core/Utils/OS/DragHelper.cs +++ b/PCL.CE/Core/Utils/OS/DragHelper.cs @@ -1,202 +1,202 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Windows; -using System.Windows.Interop; - -namespace PCL.Core.Utils.OS; - -// ReSharper disable InconsistentNaming -public partial class DragHelper -{ - public event EventHandler? DragDrop; - - public string[]? DropFilePaths { get; private set; } - public Point DropDragPoint { get; private set; } - - public HwndSource? HwndSource { get; set; } - - #region Public API - - public void AddHook() - { - if (HwndSource is null) - throw new InvalidOperationException("HwndSource 未设置"); - - RemoveHook(); - - HwndSource.AddHook(WndProc); - IntPtr hwnd = HwndSource.Handle; - - if (IsUserAnAdmin()) - RevokeDragDrop(hwnd); - - DragAcceptFiles(hwnd, true); - ChangeMessageFilter(hwnd); - } - - public void RemoveHook() - { - if (HwndSource is null) - return; - - HwndSource.RemoveHook(WndProc); - DragAcceptFiles(HwndSource.Handle, false); - } - - #endregion - - #region WndProc - - private IntPtr WndProc( - IntPtr hwnd, - int msg, - IntPtr wParam, - IntPtr lParam, - ref bool handled) - { - if (TryGetDropInfo(msg, wParam, out var files, out var pt)) - { - DropFilePaths = files; - DropDragPoint = new Point(pt.X, pt.Y); - DragDrop?.Invoke(this, EventArgs.Empty); - handled = true; - } - - return IntPtr.Zero; - } - - #endregion - - #region Message filter (UAC) - - private static unsafe void ChangeMessageFilter(IntPtr hwnd) - { - var ver = Environment.OSVersion.Version; - if (ver < new Version(6, 0)) - return; - - var win7OrHigher = ver >= new Version(6, 1); - - var filter = new CHANGEFILTERSTRUCT - { - cbSize = (uint)sizeof(CHANGEFILTERSTRUCT) - }; - - uint[] messages = [ - WM_DROPFILES, - WM_COPYGLOBALDATA, - WM_COPYDATA - ]; - - foreach (var msg in messages) - { - var ok = win7OrHigher - ? ChangeWindowMessageFilterEx(hwnd, msg, MSGFLT_ALLOW, ref filter) - : ChangeWindowMessageFilter(msg, MSGFLT_ADD); - - if (!ok) throw new Win32Exception(Marshal.GetLastWin32Error()); - } - } - - #endregion - - #region Drop parsing - - private static bool TryGetDropInfo( - int msg, - IntPtr hDrop, - out string[]? filePaths, - out DragPoint dropPoint) - { - filePaths = null; - dropPoint = default; - - if (msg != WM_DROPFILES) - return false; - - var count = DragQueryFile(hDrop, uint.MaxValue, IntPtr.Zero, 0); - filePaths = new string[count]; - - const int maxPath = 32768, smallerMaxPath = 1024; - - Span gBuffer = stackalloc char[smallerMaxPath]; - for (uint i = 0; i < count; i++) - { - var len = DragQueryFile(hDrop, i, IntPtr.Zero, 0) + 1; - if (len > maxPath) len = maxPath; - var buffer = len <= smallerMaxPath ? gBuffer[..(int)len] : new char[len]; - _ = DragQueryFile(hDrop, i, buffer, len); - filePaths[i] = new string(buffer[..(int)(len - 1)]); - } - - DragFinish(hDrop); - return true; - } - - #endregion - - #region Win32 - - private const uint WM_COPYGLOBALDATA = 0x0049; - private const uint WM_COPYDATA = 0x004A; - private const uint WM_DROPFILES = 0x0233; - - private const uint MSGFLT_ALLOW = 1; - private const uint MSGFLT_ADD = 1; - - [LibraryImport("user32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static partial bool ChangeWindowMessageFilter( - uint msg, - uint flags); - - [LibraryImport("user32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static partial bool ChangeWindowMessageFilterEx( - IntPtr hwnd, - uint msg, - uint action, - ref CHANGEFILTERSTRUCT filter); - - [LibraryImport("shell32.dll")] - private static partial void DragAcceptFiles( - IntPtr hwnd, - [MarshalAs(UnmanagedType.Bool)] bool accept); - - [LibraryImport("shell32.dll", EntryPoint = "DragQueryFileW", StringMarshalling = StringMarshalling.Utf16)] - private static partial uint DragQueryFile(IntPtr hDrop, uint iFile, Span lpszFile, uint cch); - - [LibraryImport("shell32.dll", EntryPoint = "DragQueryFileW")] - private static partial uint DragQueryFile(IntPtr hDrop, uint iFile, IntPtr lpszFile, uint cch); - - [LibraryImport("shell32.dll")] - private static partial void DragFinish(IntPtr hDrop); - - [LibraryImport("ole32.dll")] - private static partial int RevokeDragDrop(IntPtr hwnd); - - [LibraryImport("shell32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - private static partial bool IsUserAnAdmin(); - - #endregion - - #region Structs - - [StructLayout(LayoutKind.Sequential)] - private struct DragPoint - { - public int X; - public int Y; - } - - [StructLayout(LayoutKind.Sequential)] - private struct CHANGEFILTERSTRUCT - { - public uint cbSize; - public uint ExtStatus; - } - - #endregion -} +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Interop; + +namespace PCL.CE.Core.Utils.OS; + +// ReSharper disable InconsistentNaming +public partial class DragHelper +{ + public event EventHandler? DragDrop; + + public string[]? DropFilePaths { get; private set; } + public Point DropDragPoint { get; private set; } + + public HwndSource? HwndSource { get; set; } + + #region Public API + + public void AddHook() + { + if (HwndSource is null) + throw new InvalidOperationException("HwndSource 未设置"); + + RemoveHook(); + + HwndSource.AddHook(WndProc); + IntPtr hwnd = HwndSource.Handle; + + if (IsUserAnAdmin()) + RevokeDragDrop(hwnd); + + DragAcceptFiles(hwnd, true); + ChangeMessageFilter(hwnd); + } + + public void RemoveHook() + { + if (HwndSource is null) + return; + + HwndSource.RemoveHook(WndProc); + DragAcceptFiles(HwndSource.Handle, false); + } + + #endregion + + #region WndProc + + private IntPtr WndProc( + IntPtr hwnd, + int msg, + IntPtr wParam, + IntPtr lParam, + ref bool handled) + { + if (TryGetDropInfo(msg, wParam, out var files, out var pt)) + { + DropFilePaths = files; + DropDragPoint = new Point(pt.X, pt.Y); + DragDrop?.Invoke(this, EventArgs.Empty); + handled = true; + } + + return IntPtr.Zero; + } + + #endregion + + #region Message filter (UAC) + + private static unsafe void ChangeMessageFilter(IntPtr hwnd) + { + var ver = Environment.OSVersion.Version; + if (ver < new Version(6, 0)) + return; + + var win7OrHigher = ver >= new Version(6, 1); + + var filter = new CHANGEFILTERSTRUCT + { + cbSize = (uint)sizeof(CHANGEFILTERSTRUCT) + }; + + uint[] messages = [ + WM_DROPFILES, + WM_COPYGLOBALDATA, + WM_COPYDATA + ]; + + foreach (var msg in messages) + { + var ok = win7OrHigher + ? ChangeWindowMessageFilterEx(hwnd, msg, MSGFLT_ALLOW, ref filter) + : ChangeWindowMessageFilter(msg, MSGFLT_ADD); + + if (!ok) throw new Win32Exception(Marshal.GetLastWin32Error()); + } + } + + #endregion + + #region Drop parsing + + private static bool TryGetDropInfo( + int msg, + IntPtr hDrop, + out string[]? filePaths, + out DragPoint dropPoint) + { + filePaths = null; + dropPoint = default; + + if (msg != WM_DROPFILES) + return false; + + var count = DragQueryFile(hDrop, uint.MaxValue, IntPtr.Zero, 0); + filePaths = new string[count]; + + const int maxPath = 32768, smallerMaxPath = 1024; + + Span gBuffer = stackalloc char[smallerMaxPath]; + for (uint i = 0; i < count; i++) + { + var len = DragQueryFile(hDrop, i, IntPtr.Zero, 0) + 1; + if (len > maxPath) len = maxPath; + var buffer = len <= smallerMaxPath ? gBuffer[..(int)len] : new char[len]; + _ = DragQueryFile(hDrop, i, buffer, len); + filePaths[i] = new string(buffer[..(int)(len - 1)]); + } + + DragFinish(hDrop); + return true; + } + + #endregion + + #region Win32 + + private const uint WM_COPYGLOBALDATA = 0x0049; + private const uint WM_COPYDATA = 0x004A; + private const uint WM_DROPFILES = 0x0233; + + private const uint MSGFLT_ALLOW = 1; + private const uint MSGFLT_ADD = 1; + + [LibraryImport("user32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static partial bool ChangeWindowMessageFilter( + uint msg, + uint flags); + + [LibraryImport("user32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + private static partial bool ChangeWindowMessageFilterEx( + IntPtr hwnd, + uint msg, + uint action, + ref CHANGEFILTERSTRUCT filter); + + [LibraryImport("shell32.dll")] + private static partial void DragAcceptFiles( + IntPtr hwnd, + [MarshalAs(UnmanagedType.Bool)] bool accept); + + [LibraryImport("shell32.dll", EntryPoint = "DragQueryFileW", StringMarshalling = StringMarshalling.Utf16)] + private static partial uint DragQueryFile(IntPtr hDrop, uint iFile, Span lpszFile, uint cch); + + [LibraryImport("shell32.dll", EntryPoint = "DragQueryFileW")] + private static partial uint DragQueryFile(IntPtr hDrop, uint iFile, IntPtr lpszFile, uint cch); + + [LibraryImport("shell32.dll")] + private static partial void DragFinish(IntPtr hDrop); + + [LibraryImport("ole32.dll")] + private static partial int RevokeDragDrop(IntPtr hwnd); + + [LibraryImport("shell32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + private static partial bool IsUserAnAdmin(); + + #endregion + + #region Structs + + [StructLayout(LayoutKind.Sequential)] + private struct DragPoint + { + public int X; + public int Y; + } + + [StructLayout(LayoutKind.Sequential)] + private struct CHANGEFILTERSTRUCT + { + public uint cbSize; + public uint ExtStatus; + } + + #endregion +} diff --git a/PCL.Core/Utils/OS/EnvironmentInterop.cs b/PCL.CE/Core/Utils/OS/EnvironmentInterop.cs similarity index 95% rename from PCL.Core/Utils/OS/EnvironmentInterop.cs rename to PCL.CE/Core/Utils/OS/EnvironmentInterop.cs index f7cc71a43..81cfd598d 100644 --- a/PCL.Core/Utils/OS/EnvironmentInterop.cs +++ b/PCL.CE/Core/Utils/OS/EnvironmentInterop.cs @@ -1,8 +1,8 @@ using System; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public static partial class EnvironmentInterop { diff --git a/PCL.Core/Utils/OS/KernelInterop.cs b/PCL.CE/Core/Utils/OS/KernelInterop.cs similarity index 99% rename from PCL.Core/Utils/OS/KernelInterop.cs rename to PCL.CE/Core/Utils/OS/KernelInterop.cs index 229258e69..134889e28 100644 --- a/PCL.Core/Utils/OS/KernelInterop.cs +++ b/PCL.CE/Core/Utils/OS/KernelInterop.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Threading; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public static partial class KernelInterop { @@ -82,7 +82,7 @@ private struct MEMORYSTATUSEX public static uint CurrentNativeThreadId => _GetCurrentThreadId(); /// - /// 直接结束当前进程。若无特殊情况请使用 + /// 直接结束当前进程。若无特殊情况请使用 /// /// 退出状态码 (返回值) public static void ExitProcess(int statusCode = 0) => _ExitProcess((uint)statusCode); diff --git a/PCL.Core/Utils/OS/NetworkUtils.cs b/PCL.CE/Core/Utils/OS/NetworkUtils.cs similarity index 96% rename from PCL.Core/Utils/OS/NetworkUtils.cs rename to PCL.CE/Core/Utils/OS/NetworkUtils.cs index fa542aade..8466e6749 100644 --- a/PCL.Core/Utils/OS/NetworkUtils.cs +++ b/PCL.CE/Core/Utils/OS/NetworkUtils.cs @@ -3,7 +3,7 @@ using System.Net.NetworkInformation; using System.Net.Sockets; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public static class NetworkUtils { diff --git a/PCL.Core/Utils/OS/NtInterop.cs b/PCL.CE/Core/Utils/OS/NtInterop.cs similarity index 98% rename from PCL.Core/Utils/OS/NtInterop.cs rename to PCL.CE/Core/Utils/OS/NtInterop.cs index 549cdc619..a3dc8457c 100644 --- a/PCL.Core/Utils/OS/NtInterop.cs +++ b/PCL.CE/Core/Utils/OS/NtInterop.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Runtime.InteropServices; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public static partial class NtInterop { diff --git a/PCL.Core/Utils/OS/ProcessInterop.cs b/PCL.CE/Core/Utils/OS/ProcessInterop.cs similarity index 99% rename from PCL.Core/Utils/OS/ProcessInterop.cs rename to PCL.CE/Core/Utils/OS/ProcessInterop.cs index d5434f851..18dd5d49f 100644 --- a/PCL.Core/Utils/OS/ProcessInterop.cs +++ b/PCL.CE/Core/Utils/OS/ProcessInterop.cs @@ -6,9 +6,9 @@ using System.Security.Principal; using System.Threading.Tasks; using Microsoft.Win32; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public class ProcessInterop { /// diff --git a/PCL.Core/Utils/OS/RegistryChangeMonitor.cs b/PCL.CE/Core/Utils/OS/RegistryChangeMonitor.cs similarity index 99% rename from PCL.Core/Utils/OS/RegistryChangeMonitor.cs rename to PCL.CE/Core/Utils/OS/RegistryChangeMonitor.cs index c53b01d49..92e978145 100644 --- a/PCL.Core/Utils/OS/RegistryChangeMonitor.cs +++ b/PCL.CE/Core/Utils/OS/RegistryChangeMonitor.cs @@ -3,7 +3,7 @@ using System.Runtime.InteropServices; using System.Threading; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public partial class RegistryChangeMonitor : IDisposable { diff --git a/PCL.Core/Utils/OS/SystemPaths.cs b/PCL.CE/Core/Utils/OS/SystemPaths.cs similarity index 89% rename from PCL.Core/Utils/OS/SystemPaths.cs rename to PCL.CE/Core/Utils/OS/SystemPaths.cs index 1abafd9e5..967fd61a0 100644 --- a/PCL.Core/Utils/OS/SystemPaths.cs +++ b/PCL.CE/Core/Utils/OS/SystemPaths.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public static class SystemPaths { /// diff --git a/PCL.Core/Utils/OS/SystemTheme.cs b/PCL.CE/Core/Utils/OS/SystemTheme.cs similarity index 95% rename from PCL.Core/Utils/OS/SystemTheme.cs rename to PCL.CE/Core/Utils/OS/SystemTheme.cs index 104832c2c..18129ae07 100644 --- a/PCL.Core/Utils/OS/SystemTheme.cs +++ b/PCL.CE/Core/Utils/OS/SystemTheme.cs @@ -2,9 +2,9 @@ using System.IO; using System.Security; using Microsoft.Win32; -using PCL.Core.Logging; +using PCL.CE.Core.Logging; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public class SystemTheme { private const string ThemeRegistryPath = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; diff --git a/PCL.Core/Utils/OS/WindowInterop.cs b/PCL.CE/Core/Utils/OS/WindowInterop.cs similarity index 99% rename from PCL.Core/Utils/OS/WindowInterop.cs rename to PCL.CE/Core/Utils/OS/WindowInterop.cs index db8a725ef..713a5384c 100644 --- a/PCL.Core/Utils/OS/WindowInterop.cs +++ b/PCL.CE/Core/Utils/OS/WindowInterop.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; using System.ComponentModel; -namespace PCL.Core.Utils.OS; +namespace PCL.CE.Core.Utils.OS; public static partial class WindowInterop { diff --git a/PCL.Core/Utils/PEHeaderReader.cs b/PCL.CE/Core/Utils/PEHeaderReader.cs similarity index 99% rename from PCL.Core/Utils/PEHeaderReader.cs rename to PCL.CE/Core/Utils/PEHeaderReader.cs index bad9d97c3..0c2892855 100644 --- a/PCL.Core/Utils/PEHeaderReader.cs +++ b/PCL.CE/Core/Utils/PEHeaderReader.cs @@ -3,7 +3,7 @@ using System.IO; using System.Text; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; // ReSharper disable InconsistentNaming diff --git a/PCL.Core/Utils/ParameterizedProperty.cs b/PCL.CE/Core/Utils/ParameterizedProperty.cs similarity index 94% rename from PCL.Core/Utils/ParameterizedProperty.cs rename to PCL.CE/Core/Utils/ParameterizedProperty.cs index 528f0b88c..270d34b6d 100644 --- a/PCL.Core/Utils/ParameterizedProperty.cs +++ b/PCL.CE/Core/Utils/ParameterizedProperty.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; /// /// 用来模拟带一个参数的属性 diff --git a/PCL.Core/Utils/RandomUtils.cs b/PCL.CE/Core/Utils/RandomUtils.cs similarity index 98% rename from PCL.Core/Utils/RandomUtils.cs rename to PCL.CE/Core/Utils/RandomUtils.cs index 2e086c73b..ec2723376 100644 --- a/PCL.Core/Utils/RandomUtils.cs +++ b/PCL.CE/Core/Utils/RandomUtils.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; using System; using System.Collections.Generic; diff --git a/PCL.Core/Utils/RegexPatterns.cs b/PCL.CE/Core/Utils/RegexPatterns.cs similarity index 99% rename from PCL.Core/Utils/RegexPatterns.cs rename to PCL.CE/Core/Utils/RegexPatterns.cs index 7d7b3aafb..02d79b309 100644 --- a/PCL.Core/Utils/RegexPatterns.cs +++ b/PCL.CE/Core/Utils/RegexPatterns.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; /// /// 基于代码生成优化的正则表达式实例。 diff --git a/PCL.Core/Utils/RegionUtils.cs b/PCL.CE/Core/Utils/RegionUtils.cs similarity index 89% rename from PCL.Core/Utils/RegionUtils.cs rename to PCL.CE/Core/Utils/RegionUtils.cs index aba3720ad..6f6cbca9c 100644 --- a/PCL.Core/Utils/RegionUtils.cs +++ b/PCL.CE/Core/Utils/RegionUtils.cs @@ -1,8 +1,8 @@ using System; using System.Globalization; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public static class RegionUtils { diff --git a/PCL.Core/Utils/Result.cs b/PCL.CE/Core/Utils/Result.cs similarity index 99% rename from PCL.Core/Utils/Result.cs rename to PCL.CE/Core/Utils/Result.cs index 37ac4473c..104b2b2dc 100644 --- a/PCL.Core/Utils/Result.cs +++ b/PCL.CE/Core/Utils/Result.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; /// /// 表示一个可能成功或失败的操作结果。 diff --git a/PCL.Core/Utils/Secret/EncryptHelper.cs b/PCL.CE/Core/Utils/Secret/EncryptHelper.cs similarity index 97% rename from PCL.Core/Utils/Secret/EncryptHelper.cs rename to PCL.CE/Core/Utils/Secret/EncryptHelper.cs index 65d832d2d..7af4bce5d 100644 --- a/PCL.Core/Utils/Secret/EncryptHelper.cs +++ b/PCL.CE/Core/Utils/Secret/EncryptHelper.cs @@ -5,12 +5,12 @@ using System.IO; using System.Security.Cryptography; using System.Text; -using PCL.Core.App; -using PCL.Core.IO; -using PCL.Core.Utils.Encryption; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App; +using PCL.CE.Core.IO; +using PCL.CE.Core.Utils.Encryption; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Secret; +namespace PCL.CE.Core.Utils.Secret; public static class EncryptHelper { diff --git a/PCL.Core/Utils/Secret/Identify.cs b/PCL.CE/Core/Utils/Secret/Identify.cs similarity index 95% rename from PCL.Core/Utils/Secret/Identify.cs rename to PCL.CE/Core/Utils/Secret/Identify.cs index 0b2ac8839..43924a7cc 100644 --- a/PCL.Core/Utils/Secret/Identify.cs +++ b/PCL.CE/Core/Utils/Secret/Identify.cs @@ -1,11 +1,11 @@ using System; using System.Management; using System.Text; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.Hash; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.Hash; -namespace PCL.Core.Utils.Secret; +namespace PCL.CE.Core.Utils.Secret; public class Identify { diff --git a/PCL.Core/Utils/Secret/IdentifyOld.cs b/PCL.CE/Core/Utils/Secret/IdentifyOld.cs similarity index 93% rename from PCL.Core/Utils/Secret/IdentifyOld.cs rename to PCL.CE/Core/Utils/Secret/IdentifyOld.cs index 99ffb7c1d..fe818cc96 100644 --- a/PCL.Core/Utils/Secret/IdentifyOld.cs +++ b/PCL.CE/Core/Utils/Secret/IdentifyOld.cs @@ -1,13 +1,13 @@ using System; using System.Management; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.Utils.Hash; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Hash; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Secret; +namespace PCL.CE.Core.Utils.Secret; -[Obsolete("Use PCL.Core.Utils.Secret.Identify instead")] +[Obsolete("Use PCL.CE.Core.Utils.Secret.Identify instead")] public static class IdentifyOld { private const string DefaultRawCode = "B09675A9351CBD1FD568056781FE3966DD936CC9B94E51AB5CF67EEB7E74C075"; diff --git a/PCL.Core/Utils/SemVer.cs b/PCL.CE/Core/Utils/SemVer.cs similarity index 99% rename from PCL.Core/Utils/SemVer.cs rename to PCL.CE/Core/Utils/SemVer.cs index 4723f3c38..296b8c28a 100644 --- a/PCL.Core/Utils/SemVer.cs +++ b/PCL.CE/Core/Utils/SemVer.cs @@ -1,7 +1,7 @@ using System; using System.Text.RegularExpressions; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; [Serializable] public class SemVer(int major, int minor, int patch, string? prerelease = null, string? buildMetadata = null) diff --git a/PCL.Core/Utils/SimilaritySearch.cs b/PCL.CE/Core/Utils/SimilaritySearch.cs similarity index 99% rename from PCL.Core/Utils/SimilaritySearch.cs rename to PCL.CE/Core/Utils/SimilaritySearch.cs index 4b769e50a..222934f0c 100644 --- a/PCL.Core/Utils/SimilaritySearch.cs +++ b/PCL.CE/Core/Utils/SimilaritySearch.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; using System; using System.Collections.Generic; diff --git a/PCL.Core/Utils/StringStream.cs b/PCL.CE/Core/Utils/StringStream.cs similarity index 98% rename from PCL.Core/Utils/StringStream.cs rename to PCL.CE/Core/Utils/StringStream.cs index 350300994..f7d47c26e 100644 --- a/PCL.Core/Utils/StringStream.cs +++ b/PCL.CE/Core/Utils/StringStream.cs @@ -2,7 +2,7 @@ using System.IO; using System.Text; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public class StringStream : Stream { diff --git a/PCL.Core/Utils/Threading/AsyncCountResetEvent.cs b/PCL.CE/Core/Utils/Threading/AsyncCountResetEvent.cs similarity index 98% rename from PCL.Core/Utils/Threading/AsyncCountResetEvent.cs rename to PCL.CE/Core/Utils/Threading/AsyncCountResetEvent.cs index 41026907c..70a3aaa57 100644 --- a/PCL.Core/Utils/Threading/AsyncCountResetEvent.cs +++ b/PCL.CE/Core/Utils/Threading/AsyncCountResetEvent.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace PCL.Core.Utils.Threading; +namespace PCL.CE.Core.Utils.Threading; // 使用 AI 生成的代码 // 时间: 2025/9/2 diff --git a/PCL.Core/Utils/Threading/AsyncDebounce.cs b/PCL.CE/Core/Utils/Threading/AsyncDebounce.cs similarity index 99% rename from PCL.Core/Utils/Threading/AsyncDebounce.cs rename to PCL.CE/Core/Utils/Threading/AsyncDebounce.cs index 21c4a07a5..0f0e66063 100644 --- a/PCL.Core/Utils/Threading/AsyncDebounce.cs +++ b/PCL.CE/Core/Utils/Threading/AsyncDebounce.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Threading; +namespace PCL.CE.Core.Utils.Threading; /// /// 可重置的异步延时器。在指定延时后执行异步任务并等待下一次重置后重复该逻辑,指定延时未到达时重置将会重新开始计时。 diff --git a/PCL.Core/Utils/Threading/AsyncManualResetEvent.cs b/PCL.CE/Core/Utils/Threading/AsyncManualResetEvent.cs similarity index 98% rename from PCL.Core/Utils/Threading/AsyncManualResetEvent.cs rename to PCL.CE/Core/Utils/Threading/AsyncManualResetEvent.cs index 2cfb8f2de..7c12a1a07 100644 --- a/PCL.Core/Utils/Threading/AsyncManualResetEvent.cs +++ b/PCL.CE/Core/Utils/Threading/AsyncManualResetEvent.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Threading; +namespace PCL.CE.Core.Utils.Threading; // Partly generated by gpt-5-mini (20250808) public sealed class AsyncManualResetEvent : IDisposable diff --git a/PCL.Core/Utils/Threading/DualThreadPool.cs b/PCL.CE/Core/Utils/Threading/DualThreadPool.cs similarity index 98% rename from PCL.Core/Utils/Threading/DualThreadPool.cs rename to PCL.CE/Core/Utils/Threading/DualThreadPool.cs index 9eeb9cda9..cd3465453 100644 --- a/PCL.Core/Utils/Threading/DualThreadPool.cs +++ b/PCL.CE/Core/Utils/Threading/DualThreadPool.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Threading; +namespace PCL.CE.Core.Utils.Threading; // Partly generated by o4-mini-high (20250709) diff --git a/PCL.Core/Utils/Threading/LimitedConcurrencyLevelTaskScheduler.cs b/PCL.CE/Core/Utils/Threading/LimitedConcurrencyLevelTaskScheduler.cs similarity index 98% rename from PCL.Core/Utils/Threading/LimitedConcurrencyLevelTaskScheduler.cs rename to PCL.CE/Core/Utils/Threading/LimitedConcurrencyLevelTaskScheduler.cs index 20b7eb0e3..d09ac2967 100644 --- a/PCL.Core/Utils/Threading/LimitedConcurrencyLevelTaskScheduler.cs +++ b/PCL.CE/Core/Utils/Threading/LimitedConcurrencyLevelTaskScheduler.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Threading; +namespace PCL.CE.Core.Utils.Threading; // Partly generated by o4-mini-high (20250709) diff --git a/PCL.Core/Utils/Threading/LimitedTaskPool.cs b/PCL.CE/Core/Utils/Threading/LimitedTaskPool.cs similarity index 97% rename from PCL.Core/Utils/Threading/LimitedTaskPool.cs rename to PCL.CE/Core/Utils/Threading/LimitedTaskPool.cs index ffb440349..7e8a059e1 100644 --- a/PCL.Core/Utils/Threading/LimitedTaskPool.cs +++ b/PCL.CE/Core/Utils/Threading/LimitedTaskPool.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils.Threading; +namespace PCL.CE.Core.Utils.Threading; // Partly generated by o4-mini-high (20250709) diff --git a/PCL.Core/Utils/TimeUtils.cs b/PCL.CE/Core/Utils/TimeUtils.cs similarity index 99% rename from PCL.Core/Utils/TimeUtils.cs rename to PCL.CE/Core/Utils/TimeUtils.cs index 65bff6518..b9857955d 100644 --- a/PCL.Core/Utils/TimeUtils.cs +++ b/PCL.CE/Core/Utils/TimeUtils.cs @@ -1,6 +1,6 @@ using Humanizer; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; using System; diff --git a/PCL.Core/Utils/Validate/BlacklistValidator.cs b/PCL.CE/Core/Utils/Validate/BlacklistValidator.cs similarity index 95% rename from PCL.Core/Utils/Validate/BlacklistValidator.cs rename to PCL.CE/Core/Utils/Validate/BlacklistValidator.cs index 1e0e14d9d..91fde27f4 100644 --- a/PCL.Core/Utils/Validate/BlacklistValidator.cs +++ b/PCL.CE/Core/Utils/Validate/BlacklistValidator.cs @@ -2,7 +2,7 @@ using FluentValidation; using FluentValidation.Results; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class BlacklistValidator(List contains) : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/FileNameValidator.cs b/PCL.CE/Core/Utils/Validate/FileNameValidator.cs similarity index 97% rename from PCL.Core/Utils/Validate/FileNameValidator.cs rename to PCL.CE/Core/Utils/Validate/FileNameValidator.cs index 4b5388f65..ae5ab340d 100644 --- a/PCL.Core/Utils/Validate/FileNameValidator.cs +++ b/PCL.CE/Core/Utils/Validate/FileNameValidator.cs @@ -3,9 +3,9 @@ using System.Linq; using FluentValidation; using FluentValidation.Results; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class FileNameValidator( string? parentFolder = null, diff --git a/PCL.Core/Utils/Validate/FileSystemValidator.cs b/PCL.CE/Core/Utils/Validate/FileSystemValidator.cs similarity index 97% rename from PCL.Core/Utils/Validate/FileSystemValidator.cs rename to PCL.CE/Core/Utils/Validate/FileSystemValidator.cs index e9a575841..aec46a982 100644 --- a/PCL.Core/Utils/Validate/FileSystemValidator.cs +++ b/PCL.CE/Core/Utils/Validate/FileSystemValidator.cs @@ -3,7 +3,7 @@ using System.Linq; using FluentValidation; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public abstract class FileSystemValidator : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/FolderNameValidator.cs b/PCL.CE/Core/Utils/Validate/FolderNameValidator.cs similarity index 97% rename from PCL.Core/Utils/Validate/FolderNameValidator.cs rename to PCL.CE/Core/Utils/Validate/FolderNameValidator.cs index 2150c2488..6df60eda5 100644 --- a/PCL.Core/Utils/Validate/FolderNameValidator.cs +++ b/PCL.CE/Core/Utils/Validate/FolderNameValidator.cs @@ -3,9 +3,9 @@ using System.Linq; using FluentValidation; using FluentValidation.Results; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class FolderNameValidator( string? parentFolder = null, diff --git a/PCL.Core/Utils/Validate/FolderPathValidator.cs b/PCL.CE/Core/Utils/Validate/FolderPathValidator.cs similarity index 97% rename from PCL.Core/Utils/Validate/FolderPathValidator.cs rename to PCL.CE/Core/Utils/Validate/FolderPathValidator.cs index affce6c9a..0166cbb64 100644 --- a/PCL.Core/Utils/Validate/FolderPathValidator.cs +++ b/PCL.CE/Core/Utils/Validate/FolderPathValidator.cs @@ -2,9 +2,9 @@ using System.IO; using FluentValidation; using FluentValidation.Results; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class FolderPathValidator(bool useMinecraftCharCheck) : FileSystemValidator { diff --git a/PCL.Core/Utils/Validate/HttpAndUncValidator.cs b/PCL.CE/Core/Utils/Validate/HttpAndUncValidator.cs similarity index 92% rename from PCL.Core/Utils/Validate/HttpAndUncValidator.cs rename to PCL.CE/Core/Utils/Validate/HttpAndUncValidator.cs index 89c15feff..c5bb9729d 100644 --- a/PCL.Core/Utils/Validate/HttpAndUncValidator.cs +++ b/PCL.CE/Core/Utils/Validate/HttpAndUncValidator.cs @@ -1,8 +1,8 @@ using FluentValidation; using FluentValidation.Results; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class HttpAndUncValidator(bool allowNullOrEmpty) : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/HttpValidator.cs b/PCL.CE/Core/Utils/Validate/HttpValidator.cs similarity index 92% rename from PCL.Core/Utils/Validate/HttpValidator.cs rename to PCL.CE/Core/Utils/Validate/HttpValidator.cs index 512b385b7..d1de9f8ed 100644 --- a/PCL.Core/Utils/Validate/HttpValidator.cs +++ b/PCL.CE/Core/Utils/Validate/HttpValidator.cs @@ -1,8 +1,8 @@ using FluentValidation; using FluentValidation.Results; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Utils.Exts; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class HttpValidator(bool allowNullOrEmpty) : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/IntValidator.cs b/PCL.CE/Core/Utils/Validate/IntValidator.cs similarity index 96% rename from PCL.Core/Utils/Validate/IntValidator.cs rename to PCL.CE/Core/Utils/Validate/IntValidator.cs index 41b9b56cc..42e6fb841 100644 --- a/PCL.Core/Utils/Validate/IntValidator.cs +++ b/PCL.CE/Core/Utils/Validate/IntValidator.cs @@ -1,7 +1,7 @@ using FluentValidation; using FluentValidation.Results; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class IntValidator(int max = int.MaxValue, int min = int.MinValue) : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/NullOrEmptyValidator.cs b/PCL.CE/Core/Utils/Validate/NullOrEmptyValidator.cs similarity index 87% rename from PCL.Core/Utils/Validate/NullOrEmptyValidator.cs rename to PCL.CE/Core/Utils/Validate/NullOrEmptyValidator.cs index ae43667ee..26b718aef 100644 --- a/PCL.Core/Utils/Validate/NullOrEmptyValidator.cs +++ b/PCL.CE/Core/Utils/Validate/NullOrEmptyValidator.cs @@ -1,6 +1,6 @@ using FluentValidation; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class NullOrEmptyValidator : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/NullOrWhiteSpaceValidator.cs b/PCL.CE/Core/Utils/Validate/NullOrWhiteSpaceValidator.cs similarity index 87% rename from PCL.Core/Utils/Validate/NullOrWhiteSpaceValidator.cs rename to PCL.CE/Core/Utils/Validate/NullOrWhiteSpaceValidator.cs index 40bc7a3ed..e79a59b3d 100644 --- a/PCL.Core/Utils/Validate/NullOrWhiteSpaceValidator.cs +++ b/PCL.CE/Core/Utils/Validate/NullOrWhiteSpaceValidator.cs @@ -1,6 +1,6 @@ using FluentValidation; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class NullOrWhiteSpaceValidator : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/RegexValidator.cs b/PCL.CE/Core/Utils/Validate/RegexValidator.cs similarity index 94% rename from PCL.Core/Utils/Validate/RegexValidator.cs rename to PCL.CE/Core/Utils/Validate/RegexValidator.cs index f4ea5df10..c0fb717cf 100644 --- a/PCL.Core/Utils/Validate/RegexValidator.cs +++ b/PCL.CE/Core/Utils/Validate/RegexValidator.cs @@ -2,7 +2,7 @@ using FluentValidation; using FluentValidation.Results; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class RegexValidator(string pattern = "", string errorMessage = "正则检查失败!") : AbstractValidator { diff --git a/PCL.Core/Utils/Validate/StringLengthValidator.cs b/PCL.CE/Core/Utils/Validate/StringLengthValidator.cs similarity index 95% rename from PCL.Core/Utils/Validate/StringLengthValidator.cs rename to PCL.CE/Core/Utils/Validate/StringLengthValidator.cs index 7ff724b8f..0cb486498 100644 --- a/PCL.Core/Utils/Validate/StringLengthValidator.cs +++ b/PCL.CE/Core/Utils/Validate/StringLengthValidator.cs @@ -1,7 +1,7 @@ using FluentValidation; using FluentValidation.Results; -namespace PCL.Core.Utils.Validate; +namespace PCL.CE.Core.Utils.Validate; public class StringLengthValidator(int min = 0, int max = int.MaxValue) : AbstractValidator { diff --git a/PCL.Core/Utils/VarIntHelper.cs b/PCL.CE/Core/Utils/VarIntHelper.cs similarity index 99% rename from PCL.Core/Utils/VarIntHelper.cs rename to PCL.CE/Core/Utils/VarIntHelper.cs index aa065ce91..b87844baa 100644 --- a/PCL.Core/Utils/VarIntHelper.cs +++ b/PCL.CE/Core/Utils/VarIntHelper.cs @@ -3,7 +3,7 @@ using System.Threading; using System.Threading.Tasks; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public static class VarIntHelper { diff --git a/PCL.Core/Utils/VersionControl/FileVersionObjects.cs b/PCL.CE/Core/Utils/VersionControl/FileVersionObjects.cs similarity index 88% rename from PCL.Core/Utils/VersionControl/FileVersionObjects.cs rename to PCL.CE/Core/Utils/VersionControl/FileVersionObjects.cs index c4e124ec3..1fc32f1c3 100644 --- a/PCL.Core/Utils/VersionControl/FileVersionObjects.cs +++ b/PCL.CE/Core/Utils/VersionControl/FileVersionObjects.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Utils.VersionControl; +namespace PCL.CE.Core.Utils.VersionControl; public struct FileVersionObjects { diff --git a/PCL.Core/Utils/VersionControl/FileVersionObjectsComparer.cs b/PCL.CE/Core/Utils/VersionControl/FileVersionObjectsComparer.cs similarity index 90% rename from PCL.Core/Utils/VersionControl/FileVersionObjectsComparer.cs rename to PCL.CE/Core/Utils/VersionControl/FileVersionObjectsComparer.cs index c825c224e..7aef0b77e 100644 --- a/PCL.Core/Utils/VersionControl/FileVersionObjectsComparer.cs +++ b/PCL.CE/Core/Utils/VersionControl/FileVersionObjectsComparer.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace PCL.Core.Utils.VersionControl; +namespace PCL.CE.Core.Utils.VersionControl; public class FileVersionObjectsComparer : IEqualityComparer { diff --git a/PCL.Core/Utils/VersionControl/IVersionControl.cs b/PCL.CE/Core/Utils/VersionControl/IVersionControl.cs similarity index 97% rename from PCL.Core/Utils/VersionControl/IVersionControl.cs rename to PCL.CE/Core/Utils/VersionControl/IVersionControl.cs index d33d1229c..b5ed058f4 100644 --- a/PCL.Core/Utils/VersionControl/IVersionControl.cs +++ b/PCL.CE/Core/Utils/VersionControl/IVersionControl.cs @@ -2,7 +2,7 @@ using System.IO; using System.Threading.Tasks; -namespace PCL.Core.Utils.VersionControl; +namespace PCL.CE.Core.Utils.VersionControl; public interface IVersionControl { diff --git a/PCL.Core/Utils/VersionControl/ObjectType.cs b/PCL.CE/Core/Utils/VersionControl/ObjectType.cs similarity index 54% rename from PCL.Core/Utils/VersionControl/ObjectType.cs rename to PCL.CE/Core/Utils/VersionControl/ObjectType.cs index 7f59d4bed..4ad1e617d 100644 --- a/PCL.Core/Utils/VersionControl/ObjectType.cs +++ b/PCL.CE/Core/Utils/VersionControl/ObjectType.cs @@ -1,4 +1,4 @@ -namespace PCL.Core.Utils.VersionControl; +namespace PCL.CE.Core.Utils.VersionControl; public enum ObjectType { diff --git a/PCL.Core/Utils/VersionControl/SnapLiteVersionControl.cs b/PCL.CE/Core/Utils/VersionControl/SnapLiteVersionControl.cs similarity index 99% rename from PCL.Core/Utils/VersionControl/SnapLiteVersionControl.cs rename to PCL.CE/Core/Utils/VersionControl/SnapLiteVersionControl.cs index 83152c57c..f96fc0595 100644 --- a/PCL.Core/Utils/VersionControl/SnapLiteVersionControl.cs +++ b/PCL.CE/Core/Utils/VersionControl/SnapLiteVersionControl.cs @@ -6,12 +6,12 @@ using System.Security.Cryptography; using System.Threading.Tasks; using LiteDB; -using PCL.Core.IO.Storage; -using PCL.Core.Logging; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.Hash; +using PCL.CE.Core.IO.Storage; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.Hash; -namespace PCL.Core.Utils.VersionControl; +namespace PCL.CE.Core.Utils.VersionControl; /* 一个基于文件结构只记录差异文件的文件版本控制系统,用于 MC 存档备份 diff --git a/PCL.Core/Utils/VersionControl/VersionData.cs b/PCL.CE/Core/Utils/VersionControl/VersionData.cs similarity index 86% rename from PCL.Core/Utils/VersionControl/VersionData.cs rename to PCL.CE/Core/Utils/VersionControl/VersionData.cs index 292fd517b..96df7d54b 100644 --- a/PCL.Core/Utils/VersionControl/VersionData.cs +++ b/PCL.CE/Core/Utils/VersionControl/VersionData.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Utils.VersionControl; +namespace PCL.CE.Core.Utils.VersionControl; public struct VersionData { diff --git a/PCL.Core/Utils/VersionRange.cs b/PCL.CE/Core/Utils/VersionRange.cs similarity index 97% rename from PCL.Core/Utils/VersionRange.cs rename to PCL.CE/Core/Utils/VersionRange.cs index 605a2045e..1b46baae8 100644 --- a/PCL.Core/Utils/VersionRange.cs +++ b/PCL.CE/Core/Utils/VersionRange.cs @@ -1,6 +1,6 @@ using System; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; public class VersionRange(Version? minVersion, Version? maxVersion) { diff --git a/PCL.Core/Utils/WpfUtils.cs b/PCL.CE/Core/Utils/WpfUtils.cs similarity index 89% rename from PCL.Core/Utils/WpfUtils.cs rename to PCL.CE/Core/Utils/WpfUtils.cs index c99eb3e7f..9e2edd80b 100644 --- a/PCL.Core/Utils/WpfUtils.cs +++ b/PCL.CE/Core/Utils/WpfUtils.cs @@ -1,6 +1,6 @@ using System.Windows; -namespace PCL.Core.Utils; +namespace PCL.CE.Core.Utils; diff --git a/PCL.Core/ViewModel/Homepage/NewsViewModel.cs b/PCL.CE/Core/ViewModel/Homepage/NewsViewModel.cs similarity index 92% rename from PCL.Core/ViewModel/Homepage/NewsViewModel.cs rename to PCL.CE/Core/ViewModel/Homepage/NewsViewModel.cs index 6a2e22cef..070efeb7d 100644 --- a/PCL.Core/ViewModel/Homepage/NewsViewModel.cs +++ b/PCL.CE/Core/ViewModel/Homepage/NewsViewModel.cs @@ -1,15 +1,15 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; -using PCL.Core.App; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Logging; -using PCL.Core.Model.Tools.News; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Model.Tools.News; using System; using System.Collections.ObjectModel; using System.Net; using System.Threading.Tasks; -namespace PCL.Core.ViewModel.Homepage; +namespace PCL.CE.Core.ViewModel.Homepage; public partial class NewsViewModel : ObservableObject { diff --git a/Plain Craft Launcher 2/FodyWeavers.xml b/PCL.CE/FodyWeavers.xml similarity index 100% rename from Plain Craft Launcher 2/FodyWeavers.xml rename to PCL.CE/FodyWeavers.xml diff --git a/Plain Craft Launcher 2/FormMain.xaml b/PCL.CE/FormMain.xaml similarity index 99% rename from Plain Craft Launcher 2/FormMain.xaml rename to PCL.CE/FormMain.xaml index 924209414..9011bb379 100644 --- a/Plain Craft Launcher 2/FormMain.xaml +++ b/PCL.CE/FormMain.xaml @@ -1,17 +1,17 @@ @@ -145,7 +145,7 @@ + Source="pack://application:,,,/PCL.CE;component/Images/Icons/HMCL.png" /> diff --git a/Plain Craft Launcher 2/FormMain.xaml.cs b/PCL.CE/FormMain.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/FormMain.xaml.cs rename to PCL.CE/FormMain.xaml.cs index 054854804..4ac757490 100644 --- a/Plain Craft Launcher 2/FormMain.xaml.cs +++ b/PCL.CE/FormMain.xaml.cs @@ -8,17 +8,17 @@ using System.Windows.Interop; using System.Windows.Media; using System.Windows.Media.Effects; -using PCL.Core.App; -using PCL.Core.App.IoC; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.UI.Theme; -using PCL.Core.Utils; -using PCL.Core.Utils.OS; -using PCL.Core.Utils.Validate; -using PCL.Network; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.UI.Theme; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; + +namespace PCL.CE; public partial class FormMain { diff --git a/Plain Craft Launcher 2/Images/Backgrounds/server_bg.png b/PCL.CE/Images/Backgrounds/server_bg.png similarity index 100% rename from Plain Craft Launcher 2/Images/Backgrounds/server_bg.png rename to PCL.CE/Images/Backgrounds/server_bg.png diff --git a/Plain Craft Launcher 2/Images/Blocks/Anvil.png b/PCL.CE/Images/Blocks/Anvil.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/Anvil.png rename to PCL.CE/Images/Blocks/Anvil.png diff --git a/Plain Craft Launcher 2/Images/Blocks/Cleanroom.png b/PCL.CE/Images/Blocks/Cleanroom.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/Cleanroom.png rename to PCL.CE/Images/Blocks/Cleanroom.png diff --git a/Plain Craft Launcher 2/Images/Blocks/CobbleStone.png b/PCL.CE/Images/Blocks/CobbleStone.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/CobbleStone.png rename to PCL.CE/Images/Blocks/CobbleStone.png diff --git a/Plain Craft Launcher 2/Images/Blocks/CommandBlock.png b/PCL.CE/Images/Blocks/CommandBlock.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/CommandBlock.png rename to PCL.CE/Images/Blocks/CommandBlock.png diff --git a/Plain Craft Launcher 2/Images/Blocks/Egg.png b/PCL.CE/Images/Blocks/Egg.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/Egg.png rename to PCL.CE/Images/Blocks/Egg.png diff --git a/Plain Craft Launcher 2/Images/Blocks/Fabric.png b/PCL.CE/Images/Blocks/Fabric.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/Fabric.png rename to PCL.CE/Images/Blocks/Fabric.png diff --git a/Plain Craft Launcher 2/Images/Blocks/GoldBlock.png b/PCL.CE/Images/Blocks/GoldBlock.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/GoldBlock.png rename to PCL.CE/Images/Blocks/GoldBlock.png diff --git a/Plain Craft Launcher 2/Images/Blocks/Grass.png b/PCL.CE/Images/Blocks/Grass.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/Grass.png rename to PCL.CE/Images/Blocks/Grass.png diff --git a/Plain Craft Launcher 2/Images/Blocks/GrassPath.png b/PCL.CE/Images/Blocks/GrassPath.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/GrassPath.png rename to PCL.CE/Images/Blocks/GrassPath.png diff --git a/Plain Craft Launcher 2/Images/Blocks/LabyMod.png b/PCL.CE/Images/Blocks/LabyMod.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/LabyMod.png rename to PCL.CE/Images/Blocks/LabyMod.png diff --git a/Plain Craft Launcher 2/Images/Blocks/NeoForge.png b/PCL.CE/Images/Blocks/NeoForge.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/NeoForge.png rename to PCL.CE/Images/Blocks/NeoForge.png diff --git a/Plain Craft Launcher 2/Images/Blocks/OptiFabric.png b/PCL.CE/Images/Blocks/OptiFabric.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/OptiFabric.png rename to PCL.CE/Images/Blocks/OptiFabric.png diff --git a/Plain Craft Launcher 2/Images/Blocks/Quilt.png b/PCL.CE/Images/Blocks/Quilt.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/Quilt.png rename to PCL.CE/Images/Blocks/Quilt.png diff --git a/Plain Craft Launcher 2/Images/Blocks/RedstoneBlock.png b/PCL.CE/Images/Blocks/RedstoneBlock.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/RedstoneBlock.png rename to PCL.CE/Images/Blocks/RedstoneBlock.png diff --git a/Plain Craft Launcher 2/Images/Blocks/RedstoneLampOff.png b/PCL.CE/Images/Blocks/RedstoneLampOff.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/RedstoneLampOff.png rename to PCL.CE/Images/Blocks/RedstoneLampOff.png diff --git a/Plain Craft Launcher 2/Images/Blocks/RedstoneLampOn.png b/PCL.CE/Images/Blocks/RedstoneLampOn.png similarity index 100% rename from Plain Craft Launcher 2/Images/Blocks/RedstoneLampOn.png rename to PCL.CE/Images/Blocks/RedstoneLampOn.png diff --git a/Plain Craft Launcher 2/Images/Heads/00ll00.png b/PCL.CE/Images/Heads/00ll00.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/00ll00.png rename to PCL.CE/Images/Heads/00ll00.png diff --git a/Plain Craft Launcher 2/Images/Heads/EasyTier.png b/PCL.CE/Images/Heads/EasyTier.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/EasyTier.png rename to PCL.CE/Images/Heads/EasyTier.png diff --git a/Plain Craft Launcher 2/Images/Heads/Hao_Tian.jpg b/PCL.CE/Images/Heads/Hao_Tian.jpg similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/Hao_Tian.jpg rename to PCL.CE/Images/Heads/Hao_Tian.jpg diff --git a/Plain Craft Launcher 2/Images/Heads/LTCat.jpg b/PCL.CE/Images/Heads/LTCat.jpg similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/LTCat.jpg rename to PCL.CE/Images/Heads/LTCat.jpg diff --git a/Plain Craft Launcher 2/Images/Heads/Logo-CE.png b/PCL.CE/Images/Heads/Logo-CE.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/Logo-CE.png rename to PCL.CE/Images/Heads/Logo-CE.png diff --git a/Plain Craft Launcher 2/Images/Heads/Logo.png b/PCL.CE/Images/Heads/Logo.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/Logo.png rename to PCL.CE/Images/Heads/Logo.png diff --git a/Plain Craft Launcher 2/Images/Heads/MCBBS.png b/PCL.CE/Images/Heads/MCBBS.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/MCBBS.png rename to PCL.CE/Images/Heads/MCBBS.png diff --git a/Plain Craft Launcher 2/Images/Heads/PCL-Community.png b/PCL.CE/Images/Heads/PCL-Community.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/PCL-Community.png rename to PCL.CE/Images/Heads/PCL-Community.png diff --git a/Plain Craft Launcher 2/Images/Heads/PCL2.png b/PCL.CE/Images/Heads/PCL2.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/PCL2.png rename to PCL.CE/Images/Heads/PCL2.png diff --git a/Plain Craft Launcher 2/Images/Heads/Patrick.png b/PCL.CE/Images/Heads/Patrick.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/Patrick.png rename to PCL.CE/Images/Heads/Patrick.png diff --git a/Plain Craft Launcher 2/Images/Heads/Pysio.jpg b/PCL.CE/Images/Heads/Pysio.jpg similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/Pysio.jpg rename to PCL.CE/Images/Heads/Pysio.jpg diff --git a/Plain Craft Launcher 2/Images/Heads/Yunmoan.jpg b/PCL.CE/Images/Heads/Yunmoan.jpg similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/Yunmoan.jpg rename to PCL.CE/Images/Heads/Yunmoan.jpg diff --git a/Plain Craft Launcher 2/Images/Heads/bangbang93.png b/PCL.CE/Images/Heads/bangbang93.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/bangbang93.png rename to PCL.CE/Images/Heads/bangbang93.png diff --git a/Plain Craft Launcher 2/Images/Heads/wiki.png b/PCL.CE/Images/Heads/wiki.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/wiki.png rename to PCL.CE/Images/Heads/wiki.png diff --git a/Plain Craft Launcher 2/Images/Heads/z0z0r4.png b/PCL.CE/Images/Heads/z0z0r4.png similarity index 100% rename from Plain Craft Launcher 2/Images/Heads/z0z0r4.png rename to PCL.CE/Images/Heads/z0z0r4.png diff --git a/Plain Craft Launcher 2/Images/Icons/A.png b/PCL.CE/Images/Icons/A.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/A.png rename to PCL.CE/Images/Icons/A.png diff --git a/Plain Craft Launcher 2/Images/Icons/B.png b/PCL.CE/Images/Icons/B.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/B.png rename to PCL.CE/Images/Icons/B.png diff --git a/Plain Craft Launcher 2/Images/Icons/DefaultServer.png b/PCL.CE/Images/Icons/DefaultServer.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/DefaultServer.png rename to PCL.CE/Images/Icons/DefaultServer.png diff --git a/Plain Craft Launcher 2/Images/Icons/Disabled.png b/PCL.CE/Images/Icons/Disabled.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/Disabled.png rename to PCL.CE/Images/Icons/Disabled.png diff --git a/Plain Craft Launcher 2/Images/Icons/Folder.png b/PCL.CE/Images/Icons/Folder.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/Folder.png rename to PCL.CE/Images/Icons/Folder.png diff --git a/Plain Craft Launcher 2/Images/Icons/HMCL.png b/PCL.CE/Images/Icons/HMCL.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/HMCL.png rename to PCL.CE/Images/Icons/HMCL.png diff --git a/Plain Craft Launcher 2/Images/Icons/NoIcon.png b/PCL.CE/Images/Icons/NoIcon.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/NoIcon.png rename to PCL.CE/Images/Icons/NoIcon.png diff --git a/Plain Craft Launcher 2/Images/Icons/R.png b/PCL.CE/Images/Icons/R.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/R.png rename to PCL.CE/Images/Icons/R.png diff --git a/Plain Craft Launcher 2/Images/Icons/Unavailable.png b/PCL.CE/Images/Icons/Unavailable.png similarity index 100% rename from Plain Craft Launcher 2/Images/Icons/Unavailable.png rename to PCL.CE/Images/Icons/Unavailable.png diff --git a/Plain Craft Launcher 2/Images/Skins/Alex.png b/PCL.CE/Images/Skins/Alex.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Alex.png rename to PCL.CE/Images/Skins/Alex.png diff --git a/Plain Craft Launcher 2/Images/Skins/Ari.png b/PCL.CE/Images/Skins/Ari.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Ari.png rename to PCL.CE/Images/Skins/Ari.png diff --git a/Plain Craft Launcher 2/Images/Skins/Efe.png b/PCL.CE/Images/Skins/Efe.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Efe.png rename to PCL.CE/Images/Skins/Efe.png diff --git a/Plain Craft Launcher 2/Images/Skins/Kai.png b/PCL.CE/Images/Skins/Kai.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Kai.png rename to PCL.CE/Images/Skins/Kai.png diff --git a/Plain Craft Launcher 2/Images/Skins/Makena.png b/PCL.CE/Images/Skins/Makena.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Makena.png rename to PCL.CE/Images/Skins/Makena.png diff --git a/Plain Craft Launcher 2/Images/Skins/Noor.png b/PCL.CE/Images/Skins/Noor.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Noor.png rename to PCL.CE/Images/Skins/Noor.png diff --git a/Plain Craft Launcher 2/Images/Skins/Steve.png b/PCL.CE/Images/Skins/Steve.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Steve.png rename to PCL.CE/Images/Skins/Steve.png diff --git a/Plain Craft Launcher 2/Images/Skins/Sunny.png b/PCL.CE/Images/Skins/Sunny.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Sunny.png rename to PCL.CE/Images/Skins/Sunny.png diff --git a/Plain Craft Launcher 2/Images/Skins/Zuri.png b/PCL.CE/Images/Skins/Zuri.png similarity index 100% rename from Plain Craft Launcher 2/Images/Skins/Zuri.png rename to PCL.CE/Images/Skins/Zuri.png diff --git a/Plain Craft Launcher 2/Images/icon.ico b/PCL.CE/Images/icon.ico similarity index 100% rename from Plain Craft Launcher 2/Images/icon.ico rename to PCL.CE/Images/icon.ico diff --git a/Plain Craft Launcher 2/Images/icon.png b/PCL.CE/Images/icon.png similarity index 100% rename from Plain Craft Launcher 2/Images/icon.png rename to PCL.CE/Images/icon.png diff --git a/Plain Craft Launcher 2/LICENCE b/PCL.CE/LICENCE similarity index 100% rename from Plain Craft Launcher 2/LICENCE rename to PCL.CE/LICENCE diff --git a/Plain Craft Launcher 2/Modules/Base/ModAnimation.cs b/PCL.CE/Modules/Base/ModAnimation.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Base/ModAnimation.cs rename to PCL.CE/Modules/Base/ModAnimation.cs index 34c691a3b..675154415 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModAnimation.cs +++ b/PCL.CE/Modules/Base/ModAnimation.cs @@ -4,11 +4,11 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Media; -using PCL.Core.App; -using PCL.Core.Utils; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public static partial class ModAnimation { diff --git a/Plain Craft Launcher 2/Modules/Base/ModBase.cs b/PCL.CE/Modules/Base/ModBase.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Base/ModBase.cs rename to PCL.CE/Modules/Base/ModBase.cs index 1e42431ad..c3ddda0cc 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModBase.cs +++ b/PCL.CE/Modules/Base/ModBase.cs @@ -22,20 +22,20 @@ using Microsoft.VisualBasic.CompilerServices; using Microsoft.Win32; using Newtonsoft.Json; -using PCL.Core.App; -using PCL.Core.IO; -using PCL.Core.Logging; -using PCL.Core.Utils; -using PCL.Core.Utils.Codecs; -using PCL.Core.Utils.Hash; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App; +using PCL.CE.Core.IO; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Codecs; +using PCL.CE.Core.Utils.Hash; +using PCL.CE.Core.Utils.OS; using Brush = System.Windows.Media.Brush; using Color = System.Windows.Media.Color; using ColorConverter = System.Windows.Media.ColorConverter; using FontFamily = System.Windows.Media.FontFamily; using Size = System.Windows.Size; -namespace PCL; +namespace PCL.CE; public static class ModBase { @@ -80,7 +80,7 @@ public static class ModBase /// /// 程序内嵌图片文件夹路径,以“/”结尾。 /// - public static readonly string PathImage = "pack://application:,,,/Plain Craft Launcher 2;component/Images/"; + public static readonly string PathImage = "pack://application:,,,/PCL.CE;component/Images/"; /// /// 当前程序的语言。 diff --git a/Plain Craft Launcher 2/Modules/Base/ModLoader.cs b/PCL.CE/Modules/Base/ModLoader.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Base/ModLoader.cs rename to PCL.CE/Modules/Base/ModLoader.cs index 7b6b9c96d..f931c50e9 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModLoader.cs +++ b/PCL.CE/Modules/Base/ModLoader.cs @@ -1,12 +1,12 @@ using Microsoft.VisualBasic.CompilerServices; -using PCL.Core.App; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; using System.Collections; using System.IO; using System.Windows.Shell; -using PCL.Network; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public static class ModLoader { diff --git a/Plain Craft Launcher 2/Modules/Base/ModSetup.cs b/PCL.CE/Modules/Base/ModSetup.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Base/ModSetup.cs rename to PCL.CE/Modules/Base/ModSetup.cs index 5e7acbd8f..dced49f40 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModSetup.cs +++ b/PCL.CE/Modules/Base/ModSetup.cs @@ -4,14 +4,14 @@ using System.Windows; using System.Windows.Media; using System.Windows.Media.Effects; -using PCL.Core.App; -using PCL.Core.App.Configuration; -using PCL.Core.IO.Net.Http.Client; -using PCL.Core.UI.Theme; -using PCL.Core.Utils.Exts; -using PCL.Network; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Configuration; +using PCL.CE.Core.IO.Net.Http.Client; +using PCL.CE.Core.UI.Theme; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Network; + +namespace PCL.CE; public class ModSetup : IConfigScope { diff --git a/Plain Craft Launcher 2/Modules/Base/MyBitmap.cs b/PCL.CE/Modules/Base/MyBitmap.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Base/MyBitmap.cs rename to PCL.CE/Modules/Base/MyBitmap.cs index 38fcdcb61..e6b6ed7b5 100644 --- a/Plain Craft Launcher 2/Modules/Base/MyBitmap.cs +++ b/PCL.CE/Modules/Base/MyBitmap.cs @@ -5,12 +5,12 @@ using System.IO; using System.Windows.Media; using System.Windows.Media.Imaging; -using PCL.Core.UI.Media; +using PCL.CE.Core.UI.Media; using PixelFormat = System.Drawing.Imaging.PixelFormat; // 一个万能的自动图片类型转换工具类 -namespace PCL; +namespace PCL.CE; public class MyBitmap { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.cs b/PCL.CE/Modules/Minecraft/ModComp.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModComp.cs rename to PCL.CE/Modules/Minecraft/ModComp.cs index bb6215166..15da52fc8 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModComp.cs +++ b/PCL.CE/Modules/Minecraft/ModComp.cs @@ -13,14 +13,14 @@ using Dapper; using Microsoft.Data.Sqlite; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.Utils; -using PCL.Core.Utils.Hash; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Hash; +using PCL.CE.Network; using ProtoBuf; -namespace PCL; +namespace PCL.CE; public static class ModComp { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModCrash.cs b/PCL.CE/Modules/Minecraft/ModCrash.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModCrash.cs rename to PCL.CE/Modules/Minecraft/ModCrash.cs index a380dfb89..47221d785 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModCrash.cs +++ b/PCL.CE/Modules/Minecraft/ModCrash.cs @@ -3,13 +3,13 @@ using System.Text; using System.Text.RegularExpressions; using Microsoft.VisualBasic; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.Utils; -using PCL.Core.Utils.Codecs; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Codecs; +using PCL.CE.Core.Utils.Exts; -namespace PCL; +namespace PCL.CE; public class CrashAnalyzer { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModDownload.cs b/PCL.CE/Modules/Minecraft/ModDownload.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModDownload.cs rename to PCL.CE/Modules/Minecraft/ModDownload.cs index 25e91fa0f..5a591905d 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModDownload.cs +++ b/PCL.CE/Modules/Minecraft/ModDownload.cs @@ -6,13 +6,13 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Utils; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Utils; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; -namespace PCL; +namespace PCL.CE; public static class ModDownload { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModJava.cs b/PCL.CE/Modules/Minecraft/ModJava.cs similarity index 98% rename from Plain Craft Launcher 2/Modules/Minecraft/ModJava.cs rename to PCL.CE/Modules/Minecraft/ModJava.cs index 668037865..37716b742 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModJava.cs +++ b/PCL.CE/Modules/Minecraft/ModJava.cs @@ -1,14 +1,14 @@ using System.IO; using System.Text.Json; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO; -using PCL.Core.Minecraft; -using PCL.Core.Minecraft.Java.UserPreference; -using PCL.Network; -using PCL.Network.Loaders; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.IO; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.Minecraft.Java.UserPreference; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; + +namespace PCL.CE; public static class ModJava { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs b/PCL.CE/Modules/Minecraft/ModLaunch.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs rename to PCL.CE/Modules/Minecraft/ModLaunch.cs index 8f5584d99..2fb19ef6b 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs +++ b/PCL.CE/Modules/Minecraft/ModLaunch.cs @@ -9,16 +9,16 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Minecraft; -using PCL.Core.Minecraft.Launch.Utils; -using PCL.Core.Utils; -using PCL.Core.Utils.OS; -using PCL.Core.Utils.Secret; -using PCL.Network; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.Minecraft.Launch.Utils; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Core.Utils.Secret; +using PCL.CE.Network; + +namespace PCL.CE; public static class ModLaunch { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLocalComp.cs b/PCL.CE/Modules/Minecraft/ModLocalComp.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModLocalComp.cs rename to PCL.CE/Modules/Minecraft/ModLocalComp.cs index cde11b0e7..7f5f6d955 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLocalComp.cs +++ b/PCL.CE/Modules/Minecraft/ModLocalComp.cs @@ -5,12 +5,12 @@ using fNbt; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.Utils; -using static PCL.ModComp; -using static PCL.ModLoader; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; +using static PCL.CE.ModComp; +using static PCL.CE.ModLoader; -namespace PCL; +namespace PCL.CE; public static class ModLocalComp { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs b/PCL.CE/Modules/Minecraft/ModMinecraft.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs rename to PCL.CE/Modules/Minecraft/ModMinecraft.cs index 0a39e9a18..82c562eea 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs +++ b/PCL.CE/Modules/Minecraft/ModMinecraft.cs @@ -9,13 +9,13 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.UI; -using PCL.Core.Utils; -using PCL.Core.Utils.Exts; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public static class ModMinecraft { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.cs b/PCL.CE/Modules/Minecraft/ModModpack.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModModpack.cs rename to PCL.CE/Modules/Minecraft/ModModpack.cs index 65fe8a01d..f16abbd81 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModModpack.cs +++ b/PCL.CE/Modules/Minecraft/ModModpack.cs @@ -8,14 +8,14 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.UI; -using PCL.Core.Utils.Validate; -using PCL.Network; -using PCL.Network.Loaders; -using static PCL.ModLoader; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; +using static PCL.CE.ModLoader; + +namespace PCL.CE; public static class ModModpack { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs b/PCL.CE/Modules/Minecraft/ModProfile.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs rename to PCL.CE/Modules/Minecraft/ModProfile.cs index 83518d8ad..9d05c60e0 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs +++ b/PCL.CE/Modules/Minecraft/ModProfile.cs @@ -9,15 +9,15 @@ using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net; -using PCL.Core.Utils; -using PCL.Core.Utils.Secret; -using PCL.Core.Utils.Validate; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Secret; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; using JsonSerializer = System.Text.Json.JsonSerializer; -namespace PCL; +namespace PCL.CE; public static class ModProfile { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModStyle.cs b/PCL.CE/Modules/Minecraft/ModStyle.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModStyle.cs rename to PCL.CE/Modules/Minecraft/ModStyle.cs index 1f2799387..1e43c7b1f 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModStyle.cs +++ b/PCL.CE/Modules/Minecraft/ModStyle.cs @@ -5,9 +5,9 @@ using System.Windows.Media; using System.Windows.Threading; using Newtonsoft.Json.Linq; -using PCL.Core.UI.Controls; +using PCL.CE.Core.UI.Controls; -namespace PCL; +namespace PCL.CE; internal static class ModStyle { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs b/PCL.CE/Modules/Minecraft/ModWatcher.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs rename to PCL.CE/Modules/Minecraft/ModWatcher.cs index 1d189f6a5..b9b1b01e5 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModWatcher.cs +++ b/PCL.CE/Modules/Minecraft/ModWatcher.cs @@ -3,10 +3,10 @@ using System.Runtime.InteropServices; using System.Text; using System.Windows.Media; -using PCL.Core.App; -using PCL.Core.Logging; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; -namespace PCL; +namespace PCL.CE; public static class ModWatcher { diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModWorld.cs b/PCL.CE/Modules/Minecraft/ModWorld.cs similarity index 98% rename from Plain Craft Launcher 2/Modules/Minecraft/ModWorld.cs rename to PCL.CE/Modules/Minecraft/ModWorld.cs index fc3add076..631e1a930 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModWorld.cs +++ b/PCL.CE/Modules/Minecraft/ModWorld.cs @@ -1,9 +1,9 @@ using System.IO; using System.Text; using fNbt; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public static class ModWorld { diff --git a/Plain Craft Launcher 2/Modules/ModEvent.cs b/PCL.CE/Modules/ModEvent.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/ModEvent.cs rename to PCL.CE/Modules/ModEvent.cs index e60916e23..c3ff5b4c0 100644 --- a/Plain Craft Launcher 2/Modules/ModEvent.cs +++ b/PCL.CE/Modules/ModEvent.cs @@ -8,13 +8,13 @@ using System.Threading; using System.Windows; using System.Windows.Markup; -using PCL.Core.App; -using PCL.Core.Utils; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.OS; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Network; -namespace PCL +namespace PCL.CE { /// /// 用于在 XAML 中初始化列表对象。 diff --git a/Plain Craft Launcher 2/Modules/ModLink.cs b/PCL.CE/Modules/ModLink.cs similarity index 97% rename from Plain Craft Launcher 2/Modules/ModLink.cs rename to PCL.CE/Modules/ModLink.cs index 91ff62714..b8b736dde 100644 --- a/Plain Craft Launcher 2/Modules/ModLink.cs +++ b/PCL.CE/Modules/ModLink.cs @@ -2,19 +2,19 @@ using System.IO; using System.Runtime.InteropServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.Link.EasyTier; -using PCL.Core.Link.Lobby; -using PCL.Core.Link.McPing; -using PCL.Core.Link.McPing.Model; -using PCL.Core.Link.Natayark; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.Utils.OS; -using PCL.Network; -using PCL.Network.Loaders; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.Link.EasyTier; +using PCL.CE.Core.Link.Lobby; +using PCL.CE.Core.Link.McPing; +using PCL.CE.Core.Link.McPing.Model; +using PCL.CE.Core.Link.Natayark; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; + +namespace PCL.CE; public static class ModLink { diff --git a/Plain Craft Launcher 2/Modules/ModMain.cs b/PCL.CE/Modules/ModMain.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/ModMain.cs rename to PCL.CE/Modules/ModMain.cs index a1b6204d6..f90483f69 100644 --- a/Plain Craft Launcher 2/Modules/ModMain.cs +++ b/PCL.CE/Modules/ModMain.cs @@ -12,11 +12,11 @@ using Microsoft.VisualBasic; using Microsoft.Win32; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.UI; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public static class ModMain { diff --git a/Plain Craft Launcher 2/Modules/ModMusic.cs b/PCL.CE/Modules/ModMusic.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/ModMusic.cs rename to PCL.CE/Modules/ModMusic.cs index 8c02d3b50..c68a52680 100644 --- a/Plain Craft Launcher 2/Modules/ModMusic.cs +++ b/PCL.CE/Modules/ModMusic.cs @@ -3,10 +3,10 @@ using Microsoft.VisualBasic; using NAudio; using NAudio.Wave; -using PCL.Core.App; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public static class ModMusic { diff --git a/Plain Craft Launcher 2/Modules/ModSecret.cs b/PCL.CE/Modules/ModSecret.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/ModSecret.cs rename to PCL.CE/Modules/ModSecret.cs index 9235ca866..4067ab297 100644 --- a/Plain Craft Launcher 2/Modules/ModSecret.cs +++ b/PCL.CE/Modules/ModSecret.cs @@ -12,14 +12,14 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.UI.Theme; -using PCL.Core.Utils; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.OS; -using PCL.Core.Utils.Secret; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.UI.Theme; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Core.Utils.Secret; + +namespace PCL.CE; internal static class ModSecret { diff --git a/Plain Craft Launcher 2/Modules/ModVideoBack.cs b/PCL.CE/Modules/ModVideoBack.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/ModVideoBack.cs rename to PCL.CE/Modules/ModVideoBack.cs index ded5a573f..5296342fb 100644 --- a/Plain Craft Launcher 2/Modules/ModVideoBack.cs +++ b/PCL.CE/Modules/ModVideoBack.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public static class ModVideoBack { diff --git a/Plain Craft Launcher 2/Modules/ModWebServer.cs b/PCL.CE/Modules/ModWebServer.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/ModWebServer.cs rename to PCL.CE/Modules/ModWebServer.cs index 7a0a76674..a354a72ea 100644 --- a/Plain Craft Launcher 2/Modules/ModWebServer.cs +++ b/PCL.CE/Modules/ModWebServer.cs @@ -2,10 +2,10 @@ using System.Net; using System.Net.Http; using Microsoft.VisualBasic; -using PCL.Core.IO.Net.Http; -using PCL.Core.Link.Natayark; +using PCL.CE.Core.IO.Net.Http; +using PCL.CE.Core.Link.Natayark; -namespace PCL; +namespace PCL.CE; public static class ModWebServer { diff --git a/Plain Craft Launcher 2/Modules/Network/Downloader/DownloadRequestFactory.cs b/PCL.CE/Modules/Network/Downloader/DownloadRequestFactory.cs similarity index 97% rename from Plain Craft Launcher 2/Modules/Network/Downloader/DownloadRequestFactory.cs rename to PCL.CE/Modules/Network/Downloader/DownloadRequestFactory.cs index 4f4c3eb80..72fb9d626 100644 --- a/Plain Craft Launcher 2/Modules/Network/Downloader/DownloadRequestFactory.cs +++ b/PCL.CE/Modules/Network/Downloader/DownloadRequestFactory.cs @@ -1,7 +1,7 @@ using System.Net.Http; using Downloader; -namespace PCL.Network; +namespace PCL.CE.Network; internal static class DownloadRequestFactory { diff --git a/Plain Craft Launcher 2/Modules/Network/Downloader/FileDownloader.cs b/PCL.CE/Modules/Network/Downloader/FileDownloader.cs similarity index 97% rename from Plain Craft Launcher 2/Modules/Network/Downloader/FileDownloader.cs rename to PCL.CE/Modules/Network/Downloader/FileDownloader.cs index 101283f3f..ca9c198ed 100644 --- a/Plain Craft Launcher 2/Modules/Network/Downloader/FileDownloader.cs +++ b/PCL.CE/Modules/Network/Downloader/FileDownloader.cs @@ -2,9 +2,9 @@ using System.Net.Http; using System.Threading; using Downloader; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Network; +namespace PCL.CE.Network; public static class FileDownloader { @@ -106,7 +106,7 @@ void UpdateDownloadStat(DownloadProgressChangedEventArgs args) if (trackedFile is null) return; - trackedFile.State = PCL.Network.NetState.Downloading; + trackedFile.State = PCL.CE.Network.NetState.Downloading; trackedFile.TotalSize = args.TotalBytesToReceive > 0 ? args.TotalBytesToReceive : trackedFile.TotalSize; trackedFile.IsUnknownSize = trackedFile.TotalSize <= 0; trackedFile.DownloadedBytes = Math.Max(trackedFile.DownloadedBytes, args.ReceivedBytesSize); @@ -119,7 +119,7 @@ void UpdateDownloadStat(DownloadProgressChangedEventArgs args) if (trackedFile is null) return; - trackedFile.State = PCL.Network.NetState.Reading; + trackedFile.State = PCL.CE.Network.NetState.Reading; trackedFile.TotalSize = args.TotalBytesToReceive; trackedFile.IsUnknownSize = args.TotalBytesToReceive <= 0; trackedFile.DownloadedBytes = 0; diff --git a/Plain Craft Launcher 2/Modules/Network/Facade/ModNet.cs b/PCL.CE/Modules/Network/Facade/ModNet.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Network/Facade/ModNet.cs rename to PCL.CE/Modules/Network/Facade/ModNet.cs index 79173c71d..410ed1a06 100644 --- a/Plain Craft Launcher 2/Modules/Network/Facade/ModNet.cs +++ b/PCL.CE/Modules/Network/Facade/ModNet.cs @@ -1,7 +1,7 @@ using System.IO; using System.Text; -namespace PCL.Network; +namespace PCL.CE.Network; public static class ModNet { diff --git a/Plain Craft Launcher 2/Modules/Network/Http/Requester.cs b/PCL.CE/Modules/Network/Http/Requester.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Network/Http/Requester.cs rename to PCL.CE/Modules/Network/Http/Requester.cs index 481ab7664..eb1b2ffa0 100644 --- a/Plain Craft Launcher 2/Modules/Network/Http/Requester.cs +++ b/PCL.CE/Modules/Network/Http/Requester.cs @@ -5,9 +5,9 @@ using System.Text; using Downloader; using Newtonsoft.Json.Linq; -using PCL.Core.IO.Net; +using PCL.CE.Core.IO.Net; -namespace PCL.Network; +namespace PCL.CE.Network; public static class Requester { diff --git a/Plain Craft Launcher 2/Modules/Network/Loaders/LoaderDownload.cs b/PCL.CE/Modules/Network/Loaders/LoaderDownload.cs similarity index 83% rename from Plain Craft Launcher 2/Modules/Network/Loaders/LoaderDownload.cs rename to PCL.CE/Modules/Network/Loaders/LoaderDownload.cs index 8ce06983a..8745bfac2 100644 --- a/Plain Craft Launcher 2/Modules/Network/Loaders/LoaderDownload.cs +++ b/PCL.CE/Modules/Network/Loaders/LoaderDownload.cs @@ -2,13 +2,13 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Network.Loaders; +namespace PCL.CE.Network.Loaders; public class LoaderDownload : ModLoader.LoaderBase { - public ModBase.SafeList Files; + public ModBase.SafeList Files; private int _fileRemain; private readonly object _fileRemainLock = new(); private double _progress; @@ -21,10 +21,10 @@ public override double Progress set => throw new Exception("文件下载不允许指定进度"); } - public LoaderDownload(string name, List fileTasks) + public LoaderDownload(string name, List fileTasks) { Name = name; - Files = new ModBase.SafeList(fileTasks ?? new List()); + Files = new ModBase.SafeList(fileTasks ?? new List()); } public void RefreshStat() @@ -40,8 +40,8 @@ public void RefreshStat() public override void Start(object Input = null, bool IsForceRestart = false) { - if (Input is List inputFiles) - Files = new ModBase.SafeList(inputFiles); + if (Input is List inputFiles) + Files = new ModBase.SafeList(inputFiles); lock (LockState) { @@ -87,7 +87,7 @@ private void Run(CancellationToken cancellationToken) catch (Exception ex) { file.Errors.Add(ex); - file.State = PCL.Network.NetState.Interrupted; + file.State = PCL.CE.Network.NetState.Interrupted; exceptions.Enqueue(ex); _cancellationTokenSource?.Cancel(); } @@ -117,7 +117,7 @@ private int GetMaxParallelFiles() return Math.Max(1, Math.Min(Files.Count, Math.Clamp(ModNet.NetTaskThreadLimit, 1, 64))); } - private async Task ProcessFileAsync(PCL.Network.DownloadFile file, CancellationToken cancellationToken) + private async Task ProcessFileAsync(PCL.CE.Network.DownloadFile file, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); if (!file.Loaders.Contains(this)) @@ -127,7 +127,7 @@ private async Task ProcessFileAsync(PCL.Network.DownloadFile file, CancellationT if (file.Check?.CanUseExistsFile == true && file.Check.Check(file.LocalPath) is null) { file.IsCopy = true; - file.State = PCL.Network.NetState.Finished; + file.State = PCL.CE.Network.NetState.Finished; file.TotalSize = new FileInfo(file.LocalPath).Length; file.DownloadedBytes = file.TotalSize; file.Speed = 0; @@ -136,7 +136,7 @@ private async Task ProcessFileAsync(PCL.Network.DownloadFile file, CancellationT return; } - file.State = PCL.Network.NetState.Connecting; + file.State = PCL.CE.Network.NetState.Connecting; var enableParallelChunks = Files.Count <= 1; await FileDownloader.Download(file.Urls, file.LocalPath, file.UseBrowserUserAgent, file.CustomUserAgent, cancellationToken, enableParallelChunks, file).ConfigureAwait(false); @@ -145,11 +145,11 @@ await FileDownloader.Download(file.Urls, file.LocalPath, file.UseBrowserUserAgen file.DownloadedBytes = Math.Max(0, file.TotalSize); file.Speed = 0; file.ActiveThreads = 0; - file.State = PCL.Network.NetState.Finished; + file.State = PCL.CE.Network.NetState.Finished; OnFileFinish(file); } - public void OnFileFinish(PCL.Network.DownloadFile file) + public void OnFileFinish(PCL.CE.Network.DownloadFile file) { lock (_fileRemainLock) { @@ -174,7 +174,7 @@ public void OnFinish() ModNet.NetManager.Finish(this); } - public void OnFileFail(PCL.Network.DownloadFile file) + public void OnFileFail(PCL.CE.Network.DownloadFile file) { OnFail(file.Errors.Any() ? file.Errors : new List { new Exception($"文件下载失败:{file.LocalPath}") }); } @@ -190,9 +190,9 @@ public void OnFail(List exList) } FailCount += exList.Count; - foreach (var file in Files.Where(file => file.State < PCL.Network.NetState.Finished)) + foreach (var file in Files.Where(file => file.State < PCL.CE.Network.NetState.Finished)) { - file.State = PCL.Network.NetState.Interrupted; + file.State = PCL.CE.Network.NetState.Interrupted; file.Speed = 0; file.ActiveThreads = 0; file.Errors.AddRange(exList); @@ -211,9 +211,9 @@ public override void Abort() } _cancellationTokenSource?.Cancel(); - foreach (var file in Files.Where(file => file.State < PCL.Network.NetState.Finished)) + foreach (var file in Files.Where(file => file.State < PCL.CE.Network.NetState.Finished)) { - file.State = PCL.Network.NetState.Interrupted; + file.State = PCL.CE.Network.NetState.Interrupted; file.Speed = 0; file.ActiveThreads = 0; } diff --git a/Plain Craft Launcher 2/Modules/Network/Loaders/LoaderDownloadUnc.cs b/PCL.CE/Modules/Network/Loaders/LoaderDownloadUnc.cs similarity index 98% rename from Plain Craft Launcher 2/Modules/Network/Loaders/LoaderDownloadUnc.cs rename to PCL.CE/Modules/Network/Loaders/LoaderDownloadUnc.cs index 85084385c..36ff6272d 100644 --- a/Plain Craft Launcher 2/Modules/Network/Loaders/LoaderDownloadUnc.cs +++ b/PCL.CE/Modules/Network/Loaders/LoaderDownloadUnc.cs @@ -1,7 +1,7 @@ using System.IO; using System.Threading; -namespace PCL.Network.Loaders; +namespace PCL.CE.Network.Loaders; public class LoaderDownloadUnc : ModLoader.LoaderBase { diff --git a/Plain Craft Launcher 2/Modules/Network/Management/NetManager.cs b/PCL.CE/Modules/Network/Management/NetManager.cs similarity index 86% rename from Plain Craft Launcher 2/Modules/Network/Management/NetManager.cs rename to PCL.CE/Modules/Network/Management/NetManager.cs index cb9859671..4b4beb06f 100644 --- a/Plain Craft Launcher 2/Modules/Network/Management/NetManager.cs +++ b/PCL.CE/Modules/Network/Management/NetManager.cs @@ -1,4 +1,4 @@ -namespace PCL.Network; +namespace PCL.CE.Network; public sealed class NetManager { @@ -7,7 +7,7 @@ public sealed class NetManager public Dictionary Files { get; } = new(); public object LockFiles { get; } = new(); - public ModBase.SafeList Tasks { get; } = new(); + public ModBase.SafeList Tasks { get; } = new(); public object LockRemain { get; } = new(); public int FileRemain { @@ -51,7 +51,7 @@ public int ThreadCount } } - public void Start(PCL.Network.Loaders.LoaderDownload task) + public void Start(PCL.CE.Network.Loaders.LoaderDownload task) { lock (LockFiles) { @@ -62,7 +62,7 @@ public void Start(PCL.Network.Loaders.LoaderDownload task) } } - public void Finish(PCL.Network.Loaders.LoaderDownload task) + public void Finish(PCL.CE.Network.Loaders.LoaderDownload task) { lock (LockFiles) { diff --git a/Plain Craft Launcher 2/Modules/Network/Models/DownloadFile.cs b/PCL.CE/Modules/Network/Models/DownloadFile.cs similarity index 93% rename from Plain Craft Launcher 2/Modules/Network/Models/DownloadFile.cs rename to PCL.CE/Modules/Network/Models/DownloadFile.cs index 451a3b78c..1e7e937bb 100644 --- a/Plain Craft Launcher 2/Modules/Network/Models/DownloadFile.cs +++ b/PCL.CE/Modules/Network/Models/DownloadFile.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL.Network; +namespace PCL.CE.Network; public class DownloadFile { @@ -17,7 +17,7 @@ public class DownloadFile public long DownloadedBytes { get; set; } public bool IsCopy { get; set; } public List Errors { get; } = new(); - public List Loaders { get; } = new(); + public List Loaders { get; } = new(); public long Speed { get; set; } public int ActiveThreads { get; set; } public double Progress diff --git a/Plain Craft Launcher 2/Modules/Network/Models/FetchParam.cs b/PCL.CE/Modules/Network/Models/FetchParam.cs similarity index 95% rename from Plain Craft Launcher 2/Modules/Network/Models/FetchParam.cs rename to PCL.CE/Modules/Network/Models/FetchParam.cs index c858f0792..4362461a6 100644 --- a/Plain Craft Launcher 2/Modules/Network/Models/FetchParam.cs +++ b/PCL.CE/Modules/Network/Models/FetchParam.cs @@ -1,6 +1,6 @@ using System.Text; -namespace PCL.Network; +namespace PCL.CE.Network; public struct FetchParam { diff --git a/Plain Craft Launcher 2/Modules/Network/Models/NetworkEnums.cs b/PCL.CE/Modules/Network/Models/NetworkEnums.cs similarity index 92% rename from Plain Craft Launcher 2/Modules/Network/Models/NetworkEnums.cs rename to PCL.CE/Modules/Network/Models/NetworkEnums.cs index 0a7587fab..3ef04d807 100644 --- a/Plain Craft Launcher 2/Modules/Network/Models/NetworkEnums.cs +++ b/PCL.CE/Modules/Network/Models/NetworkEnums.cs @@ -1,4 +1,4 @@ -namespace PCL.Network; +namespace PCL.CE.Network; public enum NetState { diff --git a/Plain Craft Launcher 2/Modules/Network/Models/RequestParam.cs b/PCL.CE/Modules/Network/Models/RequestParam.cs similarity index 94% rename from Plain Craft Launcher 2/Modules/Network/Models/RequestParam.cs rename to PCL.CE/Modules/Network/Models/RequestParam.cs index 88c7bbdb7..4af26aa1e 100644 --- a/Plain Craft Launcher 2/Modules/Network/Models/RequestParam.cs +++ b/PCL.CE/Modules/Network/Models/RequestParam.cs @@ -1,6 +1,6 @@ using System.Text; -namespace PCL.Network; +namespace PCL.CE.Network; public struct RequestParam { diff --git a/Plain Craft Launcher 2/Modules/Updates/EnumUpdateChannel.cs b/PCL.CE/Modules/Updates/EnumUpdateChannel.cs similarity index 84% rename from Plain Craft Launcher 2/Modules/Updates/EnumUpdateChannel.cs rename to PCL.CE/Modules/Updates/EnumUpdateChannel.cs index 8fc491471..5e2f8adef 100644 --- a/Plain Craft Launcher 2/Modules/Updates/EnumUpdateChannel.cs +++ b/PCL.CE/Modules/Updates/EnumUpdateChannel.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public enum UpdateChannel { diff --git a/Plain Craft Launcher 2/Modules/Updates/IUpdateSource.cs b/PCL.CE/Modules/Updates/IUpdateSource.cs similarity index 94% rename from Plain Craft Launcher 2/Modules/Updates/IUpdateSource.cs rename to PCL.CE/Modules/Updates/IUpdateSource.cs index 09639eb65..63f7bc657 100644 --- a/Plain Craft Launcher 2/Modules/Updates/IUpdateSource.cs +++ b/PCL.CE/Modules/Updates/IUpdateSource.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public interface IUpdateSource { diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.cs b/PCL.CE/Modules/Updates/UpdatesMinioModel.cs similarity index 98% rename from Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.cs rename to PCL.CE/Modules/Updates/UpdatesMinioModel.cs index 80004717c..495a8836c 100644 --- a/Plain Craft Launcher 2/Modules/Updates/UpdatesMinioModel.cs +++ b/PCL.CE/Modules/Updates/UpdatesMinioModel.cs @@ -2,13 +2,13 @@ using System.IO.Compression; using System.Net.Http; using Newtonsoft.Json.Linq; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Utils; -using PCL.Core.Utils.Diff; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Diff; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; -namespace PCL; +namespace PCL.CE; public class UpdatesMinioModel : IUpdateSource // 社区自己的更新系统格式 { diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.cs b/PCL.CE/Modules/Updates/UpdatesMirrorChyanModel.cs similarity index 94% rename from Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.cs rename to PCL.CE/Modules/Updates/UpdatesMirrorChyanModel.cs index 3226500b1..9e59e94a3 100644 --- a/Plain Craft Launcher 2/Modules/Updates/UpdatesMirrorChyanModel.cs +++ b/PCL.CE/Modules/Updates/UpdatesMirrorChyanModel.cs @@ -1,12 +1,12 @@ using System.Net.Http; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Utils; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Utils; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; -namespace PCL; +namespace PCL.CE; public class UpdatesMirrorChyanModel : IUpdateSource // Mirror 酱的更新格式 { diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.cs b/PCL.CE/Modules/Updates/UpdatesRandomModel.cs similarity index 97% rename from Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.cs rename to PCL.CE/Modules/Updates/UpdatesRandomModel.cs index 1ea9258f9..c3019bae7 100644 --- a/Plain Craft Launcher 2/Modules/Updates/UpdatesRandomModel.cs +++ b/PCL.CE/Modules/Updates/UpdatesRandomModel.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public class UpdatesRandomModel : IUpdateSource // 社区自己的更新系统格式 { diff --git a/Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.cs b/PCL.CE/Modules/Updates/UpdatesWrapperModel.cs similarity index 99% rename from Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.cs rename to PCL.CE/Modules/Updates/UpdatesWrapperModel.cs index 9513eecfd..cf2e994c8 100644 --- a/Plain Craft Launcher 2/Modules/Updates/UpdatesWrapperModel.cs +++ b/PCL.CE/Modules/Updates/UpdatesWrapperModel.cs @@ -1,6 +1,6 @@ -using PCL.Core.Utils; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public class UpdatesWrapperModel : IUpdateSource { diff --git a/Plain Craft Launcher 2/Modules/Updates/VersionAnnouncementDataModel.cs b/PCL.CE/Modules/Updates/VersionAnnouncementDataModel.cs similarity index 97% rename from Plain Craft Launcher 2/Modules/Updates/VersionAnnouncementDataModel.cs rename to PCL.CE/Modules/Updates/VersionAnnouncementDataModel.cs index 1fbbfbb51..833ab5807 100644 --- a/Plain Craft Launcher 2/Modules/Updates/VersionAnnouncementDataModel.cs +++ b/PCL.CE/Modules/Updates/VersionAnnouncementDataModel.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public class VersionAnnouncementDataModel { diff --git a/Plain Craft Launcher 2/Modules/Updates/VersionDataModel.cs b/PCL.CE/Modules/Updates/VersionDataModel.cs similarity index 90% rename from Plain Craft Launcher 2/Modules/Updates/VersionDataModel.cs rename to PCL.CE/Modules/Updates/VersionDataModel.cs index 43a5a89eb..ef4f30ff8 100644 --- a/Plain Craft Launcher 2/Modules/Updates/VersionDataModel.cs +++ b/PCL.CE/Modules/Updates/VersionDataModel.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public class VersionDataModel { diff --git a/Plain Craft Launcher 2/Plain Craft Launcher 2.csproj b/PCL.CE/PCL.CE.csproj similarity index 57% rename from Plain Craft Launcher 2/Plain Craft Launcher 2.csproj rename to PCL.CE/PCL.CE.csproj index 3b75e7987..97a7fc043 100644 --- a/Plain Craft Launcher 2/Plain Craft Launcher 2.csproj +++ b/PCL.CE/PCL.CE.csproj @@ -3,10 +3,11 @@ enable net8.0-windows WinExe - PCL + PCL.CE + PCL.CE Custom false - PCL.Program + PCL.CE.Program publish\ true true @@ -65,39 +66,64 @@ BETA - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -107,17 +133,25 @@ false false false + true - - - - - - - + + + + + + + + + + + + + - + + diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/MyCompItem.xaml b/PCL.CE/Pages/PageDownload/Comp/MyCompItem.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/MyCompItem.xaml rename to PCL.CE/Pages/PageDownload/Comp/MyCompItem.xaml index aa7e0146f..61fc8c4c2 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/MyCompItem.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/MyCompItem.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/MyCompItem.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/MyCompItem.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/MyCompItem.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/MyCompItem.xaml.cs index 5316da2ed..0296635fa 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/MyCompItem.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/MyCompItem.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Input; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class MyCompItem { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageComp.xaml b/PCL.CE/Pages/PageDownload/Comp/PageComp.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageComp.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageComp.xaml index c020eddfc..8db0902d6 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageComp.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageComp.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageComp.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageComp.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageComp.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageComp.xaml.cs index 125ca56f4..50f7a8a6d 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageComp.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageComp.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Input; using System.Windows.Markup; -namespace PCL; +namespace PCL.CE; [ContentProperty("SearchTags")] public partial class PageComp diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml index d517c88f0..d89fecb6b 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.cs index daf4861b9..b04bcff2b 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadCompDetail.xaml.cs @@ -6,14 +6,14 @@ using System.Windows; using System.Windows.Controls; using FluentValidation; -using PCL.Core.App; -using PCL.Core.UI; -using PCL.Core.Utils.Validate; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; using Control = System.Windows.Forms.Control; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadCompDetail { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadDataPack.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadDataPack.xaml similarity index 91% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadDataPack.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadDataPack.xaml index 8b7ca95ea..8219c798d 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadDataPack.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadDataPack.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadDataPack.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadDataPack.xaml.cs similarity index 87% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadDataPack.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadDataPack.xaml.cs index 2a44b805b..a1a396700 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadDataPack.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadDataPack.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageDownloadDataPack { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadMod.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadMod.xaml similarity index 94% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadMod.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadMod.xaml index d8a1390b3..fa3a36dfb 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadMod.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadMod.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadMod.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadMod.xaml.cs similarity index 86% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadMod.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadMod.xaml.cs index da0b09f22..7b11ec77a 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadMod.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadMod.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageDownloadMod { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadPack.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadPack.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadPack.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadPack.xaml index 8bcc72737..85f6a2e4e 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadPack.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadPack.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadPack.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadPack.xaml.cs similarity index 86% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadPack.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadPack.xaml.cs index 8fc25f701..186c2fad8 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadPack.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadPack.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageDownloadPack { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml similarity index 95% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml index 12b7f2bdc..fea8d123c 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml.cs similarity index 87% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml.cs index 0b6c60808..7ebf4052e 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadResourcePack.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageDownloadResourcePack { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadShader.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadShader.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadShader.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadShader.xaml index e8fbff879..15bcfb427 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadShader.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadShader.xaml @@ -1,9 +1,9 @@ diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadShader.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadShader.xaml.cs similarity index 86% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadShader.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadShader.xaml.cs index 54f6775be..3fb1e05e0 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadShader.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadShader.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageDownloadShader { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadWorld.xaml b/PCL.CE/Pages/PageDownload/Comp/PageDownloadWorld.xaml similarity index 85% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadWorld.xaml rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadWorld.xaml index 8b8820bdc..9170b1f24 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadWorld.xaml +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadWorld.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadWorld.xaml.cs b/PCL.CE/Pages/PageDownload/Comp/PageDownloadWorld.xaml.cs similarity index 86% rename from Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadWorld.xaml.cs rename to PCL.CE/Pages/PageDownload/Comp/PageDownloadWorld.xaml.cs index b86b9062e..18f7ce963 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/Comp/PageDownloadWorld.xaml.cs +++ b/PCL.CE/Pages/PageDownload/Comp/PageDownloadWorld.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageDownloadWorld { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs b/PCL.CE/Pages/PageDownload/ModDownloadLib.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs rename to PCL.CE/Pages/PageDownload/ModDownloadLib.cs index 30ab41c33..46cec13fe 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.cs +++ b/PCL.CE/Pages/PageDownload/ModDownloadLib.cs @@ -9,15 +9,15 @@ using System.Windows.Controls.Primitives; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Minecraft; -using PCL.Core.UI; -using PCL.Core.Utils; -using PCL.Network; -using PCL.Network.Loaders; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; + +namespace PCL.CE; public static class ModDownloadLib { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCleanroom.xaml b/PCL.CE/Pages/PageDownload/PageDownloadCleanroom.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCleanroom.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadCleanroom.xaml index a505f6eff..51908a87a 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCleanroom.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadCleanroom.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCleanroom.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadCleanroom.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCleanroom.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadCleanroom.xaml.cs index 6848c4e6c..98111e4be 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCleanroom.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadCleanroom.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Controls; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadCleanroom { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadClient.xaml b/PCL.CE/Pages/PageDownload/PageDownloadClient.xaml similarity index 93% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadClient.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadClient.xaml index ba8c677d0..00ea83ce2 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadClient.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadClient.xaml @@ -1,9 +1,9 @@  + mc:Ignorable="d" x:Class="PCL.CE.PageDownloadCompFavorites"> diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompFavorites.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadCompFavorites.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompFavorites.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadCompFavorites.xaml.cs index 08349bede..c5ce61c11 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompFavorites.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadCompFavorites.xaml.cs @@ -4,11 +4,11 @@ using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; -using PCL.Core.UI; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.UI; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadCompFavorites { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadFabric.xaml b/PCL.CE/Pages/PageDownload/PageDownloadFabric.xaml similarity index 93% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadFabric.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadFabric.xaml index 65d97943e..22bd946c3 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadFabric.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadFabric.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadFabric.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadFabric.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadFabric.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadFabric.xaml.cs index 9f58e1c3a..aea36f75d 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadFabric.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadFabric.xaml.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json.Linq; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadFabric { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadForge.xaml b/PCL.CE/Pages/PageDownload/PageDownloadForge.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadForge.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadForge.xaml index 19fd0c794..19d83da0a 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadForge.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadForge.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadForge.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadForge.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadForge.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadForge.xaml.cs index 4b5eccb45..27bd4ea86 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadForge.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadForge.xaml.cs @@ -4,7 +4,7 @@ using System.Windows.Input; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadForge { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadInstall.xaml b/PCL.CE/Pages/PageDownload/PageDownloadInstall.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadInstall.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadInstall.xaml index d82c6419c..fef7eb20b 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadInstall.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadInstall.xaml @@ -1,9 +1,9 @@ + mc:Ignorable="d" x:Class="PCL.CE.PageDownloadInstall"> diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLabyMod.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadLabyMod.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLabyMod.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadLabyMod.xaml.cs index 60bf16c47..c326841d6 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLabyMod.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadLabyMod.xaml.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json.Linq; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadLabyMod { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml b/PCL.CE/Pages/PageDownload/PageDownloadLeft.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadLeft.xaml index 38c0c464f..c67a1b5cb 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadLeft.xaml @@ -1,7 +1,7 @@ - + xmlns:local="clr-namespace:PCL.CE"> diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadLeft.xaml.cs index 1caf72bc3..6bab2d7d1 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLeft.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadLeft.xaml.cs @@ -1,7 +1,7 @@ using System.Windows.Controls; using System.Windows.Input; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadLeft : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLegacyFabric.xaml b/PCL.CE/Pages/PageDownload/PageDownloadLegacyFabric.xaml similarity index 93% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLegacyFabric.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadLegacyFabric.xaml index 64b978d89..0e7b7fa9f 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLegacyFabric.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadLegacyFabric.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLegacyFabric.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadLegacyFabric.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLegacyFabric.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadLegacyFabric.xaml.cs index 41c8d4ba8..f231290e5 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLegacyFabric.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadLegacyFabric.xaml.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json.Linq; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadLegacyFabric { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLiteLoader.xaml b/PCL.CE/Pages/PageDownload/PageDownloadLiteLoader.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLiteLoader.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadLiteLoader.xaml index 2de0930a4..3dc3a5d71 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLiteLoader.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadLiteLoader.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLiteLoader.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadLiteLoader.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLiteLoader.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadLiteLoader.xaml.cs index ff07c9604..85046f127 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadLiteLoader.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadLiteLoader.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Controls; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadLiteLoader { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadNeoForge.xaml b/PCL.CE/Pages/PageDownload/PageDownloadNeoForge.xaml similarity index 93% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadNeoForge.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadNeoForge.xaml index 59312dd87..5b4b3913d 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadNeoForge.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadNeoForge.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadNeoForge.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadNeoForge.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadNeoForge.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadNeoForge.xaml.cs index 7445c2431..f2db60cca 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadNeoForge.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadNeoForge.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Controls; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadNeoForge { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadOptiFine.xaml b/PCL.CE/Pages/PageDownload/PageDownloadOptiFine.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadOptiFine.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadOptiFine.xaml index aca8497fe..83a06b9f6 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadOptiFine.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadOptiFine.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadOptiFine.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadOptiFine.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadOptiFine.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadOptiFine.xaml.cs index 2d1325274..8ec473137 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadOptiFine.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadOptiFine.xaml.cs @@ -3,7 +3,7 @@ using System.Windows.Controls; using System.Windows.Media; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadOptiFine { diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadQuilt.xaml b/PCL.CE/Pages/PageDownload/PageDownloadQuilt.xaml similarity index 93% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadQuilt.xaml rename to PCL.CE/Pages/PageDownload/PageDownloadQuilt.xaml index 79525c15e..11d73ad26 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadQuilt.xaml +++ b/PCL.CE/Pages/PageDownload/PageDownloadQuilt.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadQuilt.xaml.cs b/PCL.CE/Pages/PageDownload/PageDownloadQuilt.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageDownload/PageDownloadQuilt.xaml.cs rename to PCL.CE/Pages/PageDownload/PageDownloadQuilt.xaml.cs index b15d38cd3..6e8dbee46 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/PageDownloadQuilt.xaml.cs +++ b/PCL.CE/Pages/PageDownload/PageDownloadQuilt.xaml.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json.Linq; -namespace PCL; +namespace PCL.CE; public partial class PageDownloadQuilt { diff --git a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml b/PCL.CE/Pages/PageHomepage/PageHomepageNewsView.xaml similarity index 96% rename from Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml rename to PCL.CE/Pages/PageHomepage/PageHomepageNewsView.xaml index 850f42a79..219c39f3c 100644 --- a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml +++ b/PCL.CE/Pages/PageHomepage/PageHomepageNewsView.xaml @@ -1,13 +1,13 @@ diff --git a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs b/PCL.CE/Pages/PageHomepage/PageHomepageNewsView.xaml.cs similarity index 79% rename from Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs rename to PCL.CE/Pages/PageHomepage/PageHomepageNewsView.xaml.cs index f5c718673..dd70f13ea 100644 --- a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs +++ b/PCL.CE/Pages/PageHomepage/PageHomepageNewsView.xaml.cs @@ -1,6 +1,6 @@ -using PCL.Core.ViewModel.Homepage; +using PCL.CE.Core.ViewModel.Homepage; -namespace PCL +namespace PCL.CE { public partial class PageHomepageNewsView : MyPageRight { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/MyLocalModItem.xaml b/PCL.CE/Pages/PageInstance/MyLocalModItem.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageInstance/MyLocalModItem.xaml rename to PCL.CE/Pages/PageInstance/MyLocalModItem.xaml index 0115a3922..32f478cd6 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/MyLocalModItem.xaml +++ b/PCL.CE/Pages/PageInstance/MyLocalModItem.xaml @@ -1,9 +1,9 @@ diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceCompResource.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceCompResource.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceCompResource.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceCompResource.xaml.cs index cee050544..56aa9ccc3 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceCompResource.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceCompResource.xaml.cs @@ -6,16 +6,16 @@ using System.Windows.Input; using System.Windows.Threading; using Microsoft.VisualBasic.FileIO; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.UI.Theme; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.UI.Theme; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; using FileSystem = Microsoft.VisualBasic.FileSystem; using SearchOption = System.IO.SearchOption; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceCompResource : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceExport.xaml b/PCL.CE/Pages/PageInstance/PageInstanceExport.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceExport.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceExport.xaml index 4cec6927d..d160b8a1f 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceExport.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceExport.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceExport.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceExport.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceExport.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceExport.xaml.cs index 5ded48140..272819520 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceExport.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceExport.xaml.cs @@ -8,10 +8,10 @@ using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.UI; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; -namespace PCL; +namespace PCL.CE; public class ExportOption { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml b/PCL.CE/Pages/PageInstance/PageInstanceInstall.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceInstall.xaml index 5c73084e1..8132a1cdf 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceInstall.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceInstall.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceInstall.xaml.cs index 02aefaf3d..cb10f4a87 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceInstall.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceInstall.xaml.cs @@ -9,9 +9,9 @@ using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json.Linq; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceInstall { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceLeft.xaml b/PCL.CE/Pages/PageInstance/PageInstanceLeft.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceLeft.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceLeft.xaml index 836f2374a..2dd5c28da 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceLeft.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceLeft.xaml @@ -1,7 +1,7 @@ - + xmlns:local="clr-namespace:PCL.CE" AnimatedControl="{Binding ElementName=PanItem, Mode=OneWay}"> diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceLeft.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceLeft.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceLeft.xaml.cs index 3e36c92fa..4a859b027 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceLeft.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceLeft.xaml.cs @@ -1,8 +1,8 @@ using System.Windows; using System.Windows.Controls; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceLeft : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceModDisabled.xaml b/PCL.CE/Pages/PageInstance/PageInstanceModDisabled.xaml similarity index 95% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceModDisabled.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceModDisabled.xaml index fc0f6c9e8..aaae71cb8 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceModDisabled.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceModDisabled.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceModDisabled.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceModDisabled.xaml.cs similarity index 97% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceModDisabled.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceModDisabled.xaml.cs index 26103a85a..ea24c7968 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceModDisabled.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceModDisabled.xaml.cs @@ -1,7 +1,7 @@ using System.Windows; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceModDisabled { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceOverall.xaml b/PCL.CE/Pages/PageInstance/PageInstanceOverall.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceOverall.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceOverall.xaml index 964f6d072..c061a4240 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceOverall.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceOverall.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceOverall.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceOverall.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceOverall.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceOverall.xaml.cs index ca35b4cef..7224694df 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceOverall.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceOverall.xaml.cs @@ -6,15 +6,15 @@ using FluentValidation; using Microsoft.VisualBasic.FileIO; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.App.Configuration; -using PCL.Core.App.Configuration.Storage; -using PCL.Core.Minecraft; -using PCL.Core.UI; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Configuration; +using PCL.CE.Core.App.Configuration.Storage; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.Validate; using FileSystem = Microsoft.VisualBasic.FileIO.FileSystem; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceOverall { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml b/PCL.CE/Pages/PageInstance/PageInstanceSaves.xaml similarity index 96% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceSaves.xaml index 31f1f2d60..daff55828 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceSaves.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceSaves.xaml.cs index 2de871322..46a2c536f 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves.xaml.cs @@ -7,7 +7,7 @@ using System.Windows.Threading; using Microsoft.VisualBasic.FileIO; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceSaves : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml similarity index 96% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml index 485e4cbe1..d04fb52b8 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.cs index ef067e9a7..5274f2bc0 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesBackup.xaml.cs @@ -1,10 +1,10 @@ using System.Windows; using Microsoft.VisualBasic; -using PCL.Core.IO; -using PCL.Core.UI; -using PCL.Core.Utils.VersionControl; +using PCL.CE.Core.IO; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.VersionControl; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceSavesBackup : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml index 90326a308..c1de18296 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs index c957c73e0..bd4d76359 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesDatapack.xaml.cs @@ -6,14 +6,14 @@ using System.Windows.Input; using System.Windows.Threading; using Microsoft.VisualBasic.FileIO; -using PCL.Core.App; -using PCL.Core.UI; -using PCL.Core.UI.Theme; -using PCL.Network; -using PCL.Network.Loaders; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; +using PCL.CE.Core.UI.Theme; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; using FileSystem = Microsoft.VisualBasic.FileSystem; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceSavesDatapack : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml index 5c954f63a..b76fac6c7 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml.cs index 8de2bf2ba..c6f534abc 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesInfo.xaml.cs @@ -4,7 +4,7 @@ using System.Windows.Controls; using fNbt; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceSavesInfo : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml index 35bec30aa..ee243297d 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.cs index 48d4d8ed2..ce297e139 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceSaves/PageInstanceSavesLeft.xaml.cs @@ -2,7 +2,7 @@ using System.Windows.Controls; using System.Windows.Input; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceSavesLeft : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml b/PCL.CE/Pages/PageInstance/PageInstanceScreenshot.xaml similarity index 96% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceScreenshot.xaml index b21ac077f..62e4996c1 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceScreenshot.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceScreenshot.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceScreenshot.xaml.cs index ab035d488..fb412c106 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceScreenshot.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceScreenshot.xaml.cs @@ -5,10 +5,10 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using Microsoft.VisualBasic.FileIO; -using PCL.Core.App; +using PCL.CE.Core.App; using SearchOption = System.IO.SearchOption; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceScreenshot : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceServer.xaml b/PCL.CE/Pages/PageInstance/PageInstanceServer.xaml similarity index 97% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceServer.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceServer.xaml index a127c5eb6..d2c904b44 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceServer.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceServer.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceServer.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceServer.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceServer.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceServer.xaml.cs index eef590e25..f77136caa 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceServer.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceServer.xaml.cs @@ -4,12 +4,12 @@ using System.Windows.Input; using FluentValidation; using fNbt; -using PCL.Core.Link.McPing; -using PCL.Core.Link.McPing.Model; -using PCL.Core.Minecraft; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Link.McPing; +using PCL.CE.Core.Link.McPing.Model; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.Utils.Validate; -namespace PCL; +namespace PCL.CE; public partial class PageInstanceServer : MyPageRight { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml b/PCL.CE/Pages/PageInstance/PageInstanceSetup.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml rename to PCL.CE/Pages/PageInstance/PageInstanceSetup.xaml index 704e036d4..96b4cfbe8 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml +++ b/PCL.CE/Pages/PageInstance/PageInstanceSetup.xaml @@ -1,12 +1,12 @@ diff --git a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs b/PCL.CE/Pages/PageInstance/PageInstanceSetup.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs rename to PCL.CE/Pages/PageInstance/PageInstanceSetup.xaml.cs index 4b4d0ae5f..a55dca6ce 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/PageInstanceSetup.xaml.cs +++ b/PCL.CE/Pages/PageInstance/PageInstanceSetup.xaml.cs @@ -6,15 +6,15 @@ using System.Windows.Threading; using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; -using PCL.Core.App; -using PCL.Core.App.Configuration; -using PCL.Core.IO; -using PCL.Core.Minecraft; -using PCL.Core.Minecraft.Java.UserPreference; -using PCL.Core.UI; -using PCL.Core.Utils.OS; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Configuration; +using PCL.CE.Core.IO; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.Minecraft.Java.UserPreference; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.OS; + +namespace PCL.CE; public partial class PageInstanceSetup { diff --git a/Plain Craft Launcher 2/Pages/PageInstance/ServerCard.xaml b/PCL.CE/Pages/PageInstance/ServerCard.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageInstance/ServerCard.xaml rename to PCL.CE/Pages/PageInstance/ServerCard.xaml index 9854e3c08..87f7089cd 100644 --- a/Plain Craft Launcher 2/Pages/PageInstance/ServerCard.xaml +++ b/PCL.CE/Pages/PageInstance/ServerCard.xaml @@ -1,8 +1,8 @@ - @@ -10,7 +10,7 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs b/PCL.CE/Pages/PageLaunch/MyMsgLogin.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs rename to PCL.CE/Pages/PageLaunch/MyMsgLogin.xaml.cs index 66f54aad6..ffd375791 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/MyMsgLogin.xaml.cs @@ -2,10 +2,10 @@ using System.Windows.Controls; using System.Windows.Input; using Newtonsoft.Json.Linq; -using PCL.Core.UI.Controls; -using PCL.Network; +using PCL.CE.Core.UI.Controls; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public partial class MyMsgLogin { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml b/PCL.CE/Pages/PageLaunch/MySkin.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml rename to PCL.CE/Pages/PageLaunch/MySkin.xaml index 3b97a58c8..afe360289 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml +++ b/PCL.CE/Pages/PageLaunch/MySkin.xaml @@ -1,7 +1,7 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLaunchLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLaunchLeft.xaml.cs index 3d085c70a..8e2423919 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLaunchLeft.xaml.cs @@ -4,11 +4,11 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Threading; -using PCL.Core.App; -using PCL.Core.Utils; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public partial class PageLaunchLeft { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml b/PCL.CE/Pages/PageLaunch/PageLaunchRight.xaml similarity index 89% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml rename to PCL.CE/Pages/PageLaunch/PageLaunchRight.xaml index 594498836..59677d763 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml +++ b/PCL.CE/Pages/PageLaunch/PageLaunchRight.xaml @@ -1,7 +1,7 @@ - + xmlns:local="clr-namespace:PCL.CE"> diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLaunchRight.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLaunchRight.xaml.cs index 83c43c738..8913a2c8d 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLaunchRight.xaml.cs @@ -1,11 +1,11 @@ using System.IO; using System.Windows; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public partial class PageLaunchRight : IRefreshable { @@ -418,7 +418,7 @@ private void LoadContent(string Content) while (Content.Contains("xmlns")) Content = Content.RegexReplace("xmlns[^\"']*(\"|')[^\"']*(\"|')", "").Replace("xmlns", ""); Content = - $"{Content}"; + $"{Content}"; ModBase.Log($"[Page] 实例化:加载主页 UI 开始,最终内容长度:{Content.Count()}"); PanCustom.Children.Add((UIElement)ModBase.GetObjectFromXML(Content)); } diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml b/PCL.CE/Pages/PageLaunch/PageLoginAuth.xaml similarity index 97% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml rename to PCL.CE/Pages/PageLaunch/PageLoginAuth.xaml index 73808287c..d6772ad0d 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml +++ b/PCL.CE/Pages/PageLaunch/PageLoginAuth.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLoginAuth.xaml.cs similarity index 96% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLoginAuth.xaml.cs index a44f4254e..d6f9cc66c 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLoginAuth.xaml.cs @@ -2,14 +2,14 @@ using System.Windows; using System.Windows.Controls; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.IO.Net.Http.Client.Request; -using PCL.Core.Minecraft.Yggdrasil; -using PCL.Core.Utils; -using PCL.Core.Utils.Exts; -using PCL.Core.Utils.Validate; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.Minecraft.Yggdrasil; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Exts; +using PCL.CE.Core.Utils.Validate; + +namespace PCL.CE; public partial class PageLoginAuth { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml b/PCL.CE/Pages/PageLaunch/PageLoginMs.xaml similarity index 95% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml rename to PCL.CE/Pages/PageLaunch/PageLoginMs.xaml index 2e1243c14..e15a03153 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml +++ b/PCL.CE/Pages/PageLaunch/PageLoginMs.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLoginMs.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLoginMs.xaml.cs index fb91e19a0..8ca404035 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLoginMs.xaml.cs @@ -2,7 +2,7 @@ using System.Windows; using Microsoft.VisualBasic; -namespace PCL; +namespace PCL.CE; public partial class PageLoginMs { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml b/PCL.CE/Pages/PageLaunch/PageLoginOffline.xaml similarity index 97% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml rename to PCL.CE/Pages/PageLaunch/PageLoginOffline.xaml index 989e0173a..42303852d 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml +++ b/PCL.CE/Pages/PageLaunch/PageLoginOffline.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLoginOffline.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLoginOffline.xaml.cs index 352a3ecd4..de5822911 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLoginOffline.xaml.cs @@ -1,7 +1,7 @@ using System.Windows; -using PCL.Core.Utils.Validate; +using PCL.CE.Core.Utils.Validate; -namespace PCL; +namespace PCL.CE; public partial class PageLoginOffline { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml b/PCL.CE/Pages/PageLaunch/PageLoginProfile.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml rename to PCL.CE/Pages/PageLaunch/PageLoginProfile.xaml index afc103a52..7bf966fdf 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml +++ b/PCL.CE/Pages/PageLaunch/PageLoginProfile.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLoginProfile.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLoginProfile.xaml.cs index 7fa24d50f..14671c771 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLoginProfile.xaml.cs @@ -4,9 +4,9 @@ using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Input; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageLoginProfile { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml b/PCL.CE/Pages/PageLaunch/PageLoginProfileSkin.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml rename to PCL.CE/Pages/PageLaunch/PageLoginProfileSkin.xaml index 975e561b6..53d59bbd7 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml +++ b/PCL.CE/Pages/PageLaunch/PageLoginProfileSkin.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs b/PCL.CE/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs rename to PCL.CE/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs index b87c49eb0..5e50315d9 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs +++ b/PCL.CE/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs @@ -1,7 +1,7 @@ using System.Windows; using System.Windows.Input; -namespace PCL; +namespace PCL.CE; public partial class PageLoginProfileSkin { diff --git a/Plain Craft Launcher 2/Pages/PageLogLeft.xaml b/PCL.CE/Pages/PageLogLeft.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageLogLeft.xaml rename to PCL.CE/Pages/PageLogLeft.xaml index 3c761f01a..415c8ea06 100644 --- a/Plain Craft Launcher 2/Pages/PageLogLeft.xaml +++ b/PCL.CE/Pages/PageLogLeft.xaml @@ -1,7 +1,7 @@  diff --git a/Plain Craft Launcher 2/Pages/PageLogLeft.xaml.cs b/PCL.CE/Pages/PageLogLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLogLeft.xaml.cs rename to PCL.CE/Pages/PageLogLeft.xaml.cs index 40796a2d9..55940f595 100644 --- a/Plain Craft Launcher 2/Pages/PageLogLeft.xaml.cs +++ b/PCL.CE/Pages/PageLogLeft.xaml.cs @@ -1,9 +1,9 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Documents; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageLogLeft { diff --git a/Plain Craft Launcher 2/Pages/PageLogRight.xaml b/PCL.CE/Pages/PageLogRight.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageLogRight.xaml rename to PCL.CE/Pages/PageLogRight.xaml index f1d9b0209..550414f55 100644 --- a/Plain Craft Launcher 2/Pages/PageLogRight.xaml +++ b/PCL.CE/Pages/PageLogRight.xaml @@ -1,9 +1,9 @@  + mc:Ignorable="d" x:Class="PCL.CE.PageLogRight"> diff --git a/Plain Craft Launcher 2/Pages/PageLogRight.xaml.cs b/PCL.CE/Pages/PageLogRight.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageLogRight.xaml.cs rename to PCL.CE/Pages/PageLogRight.xaml.cs index 7140c9ed3..2b1311424 100644 --- a/Plain Craft Launcher 2/Pages/PageLogRight.xaml.cs +++ b/PCL.CE/Pages/PageLogRight.xaml.cs @@ -2,10 +2,10 @@ using System.Windows; using System.Windows.Documents; using System.Windows.Media; -using PCL.Core.App; -using PCL.Core.UI; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; -namespace PCL; +namespace PCL.CE; public partial class PageLogRight { diff --git a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml b/PCL.CE/Pages/PageSelectLeft.xaml similarity index 92% rename from Plain Craft Launcher 2/Pages/PageSelectLeft.xaml rename to PCL.CE/Pages/PageSelectLeft.xaml index 80087eb69..3ddff9194 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml +++ b/PCL.CE/Pages/PageSelectLeft.xaml @@ -1,7 +1,7 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs b/PCL.CE/Pages/PageSelectLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs rename to PCL.CE/Pages/PageSelectLeft.xaml.cs index 3f5a22129..fdd2664be 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs +++ b/PCL.CE/Pages/PageSelectLeft.xaml.cs @@ -5,13 +5,13 @@ using System.Windows.Controls.Primitives; using System.Windows.Input; using FluentValidation; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.Utils.Validate; -using PCL.Network; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public partial class PageSelectLeft : IRefreshable { diff --git a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml b/PCL.CE/Pages/PageSelectRight.xaml similarity index 95% rename from Plain Craft Launcher 2/Pages/PageSelectRight.xaml rename to PCL.CE/Pages/PageSelectRight.xaml index 83361737c..d5f3e4fd1 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml +++ b/PCL.CE/Pages/PageSelectRight.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs b/PCL.CE/Pages/PageSelectRight.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs rename to PCL.CE/Pages/PageSelectRight.xaml.cs index 561c95ec8..3a5014f5d 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs +++ b/PCL.CE/Pages/PageSelectRight.xaml.cs @@ -7,12 +7,12 @@ using System.Windows.Threading; using Microsoft.VisualBasic; using Microsoft.VisualBasic.FileIO; -using PCL.Core.App; -using PCL.Core.App.Configuration; -using PCL.Core.App.Configuration.Storage; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Configuration; +using PCL.CE.Core.App.Configuration.Storage; using FileSystem = Microsoft.VisualBasic.FileIO.FileSystem; -namespace PCL; +namespace PCL.CE; public partial class PageSelectRight { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageHomePageMarket.xaml b/PCL.CE/Pages/PageSetup/PageHomePageMarket.xaml similarity index 88% rename from Plain Craft Launcher 2/Pages/PageSetup/PageHomePageMarket.xaml rename to PCL.CE/Pages/PageSetup/PageHomePageMarket.xaml index aa311d7e9..23877acda 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageHomePageMarket.xaml +++ b/PCL.CE/Pages/PageSetup/PageHomePageMarket.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageHomePageMarket.xaml.cs b/PCL.CE/Pages/PageSetup/PageHomePageMarket.xaml.cs similarity index 89% rename from Plain Craft Launcher 2/Pages/PageSetup/PageHomePageMarket.xaml.cs rename to PCL.CE/Pages/PageSetup/PageHomePageMarket.xaml.cs index 8fe82af3a..b9520bad8 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageHomePageMarket.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageHomePageMarket.xaml.cs @@ -1,9 +1,9 @@ using System; using System.Windows; using System.Windows.Input; -using PCL.Core.IO.Net.Http.Client.Request; +using PCL.CE.Core.IO.Net.Http.Client.Request; -namespace PCL +namespace PCL.CE { public partial class PageHomePageMarket : MyPageRight, IRefreshable { @@ -37,7 +37,7 @@ private void HomepageMarketGet(ModLoader.LoaderTask Task) ModBase.RunInUi(() => { PanCustom.Children.Clear(); - var element = ModBase.GetObjectFromXML($"{content}") as UIElement; + var element = ModBase.GetObjectFromXML($"{content}") as UIElement; if (element != null) { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupAbout.xaml b/PCL.CE/Pages/PageSetup/PageSetupAbout.xaml similarity index 95% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupAbout.xaml rename to PCL.CE/Pages/PageSetup/PageSetupAbout.xaml index 793e39239..d57967817 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupAbout.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupAbout.xaml @@ -1,10 +1,10 @@ + Source="/PCL.CE;component/Images/Heads/Logo-CE.png"> + Source="/PCL.CE;component/Images/Heads/LTCat.jpg"> + Source="/PCL.CE;component/Images/Heads/PCL-Community.png" /> + Source="/PCL.CE;component/Images/Heads/bangbang93.png"> + Source="/PCL.CE;component/Images/Heads/wiki.png"> + Source="/PCL.CE;component/Images/Heads/Pysio.jpg"> + Source="/PCL.CE;component/Images/Heads/Yunmoan.jpg"> + Source="/PCL.CE;component/Images/Heads/EasyTier.png"> + Source="/PCL.CE;component/Images/Heads/z0z0r4.png"> + Source="/PCL.CE;component/Images/Heads/00ll00.png"> + Source="/PCL.CE;component/Images/Heads/Patrick.png"> + Source="/PCL.CE;component/Images/Heads/Hao_Tian.jpg"> + Source="/PCL.CE;component/Images/Heads/MCBBS.png"> + Source="/PCL.CE;component/Images/Heads/PCL2.png"> diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupFeedback.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupFeedback.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupFeedback.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupFeedback.xaml.cs index 515d30556..3ffb712a9 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupFeedback.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupFeedback.xaml.cs @@ -2,10 +2,10 @@ using System.Windows.Controls; using System.Windows.Input; using Newtonsoft.Json.Linq; -using PCL.Core.Utils; -using PCL.Network; +using PCL.CE.Core.Utils; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public partial class PageSetupFeedback { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameLink.xaml b/PCL.CE/Pages/PageSetup/PageSetupGameLink.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameLink.xaml rename to PCL.CE/Pages/PageSetup/PageSetupGameLink.xaml index 61fe2fb13..d750e21f5 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameLink.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupGameLink.xaml @@ -1,9 +1,9 @@ diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameLink.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupGameLink.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameLink.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupGameLink.xaml.cs index 67da20d03..c2d983357 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameLink.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupGameLink.xaml.cs @@ -1,10 +1,10 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using PCL.Core.App; -using PCL.Core.Link.Scaffolding.EasyTier; +using PCL.CE.Core.App; +using PCL.CE.Core.Link.Scaffolding.EasyTier; -namespace PCL; +namespace PCL.CE; public partial class PageSetupGameLink { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameManage.xaml b/PCL.CE/Pages/PageSetup/PageSetupGameManage.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameManage.xaml rename to PCL.CE/Pages/PageSetup/PageSetupGameManage.xaml index 82a8b2ac6..b8df219ec 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameManage.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupGameManage.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameManage.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupGameManage.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameManage.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupGameManage.xaml.cs index 3bbf61f73..d2153c5b2 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupGameManage.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupGameManage.xaml.cs @@ -1,8 +1,8 @@ using System.Windows; using System.Windows.Controls; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageSetupGameManage { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml b/PCL.CE/Pages/PageSetup/PageSetupJava.xaml similarity index 94% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml rename to PCL.CE/Pages/PageSetup/PageSetupJava.xaml index 944cfc54d..6f951ccc7 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupJava.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupJava.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupJava.xaml.cs index 6991ddc31..b52eedbc1 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupJava.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupJava.xaml.cs @@ -2,11 +2,11 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Media; -using PCL.Core.App; -using PCL.Core.Minecraft; -using PCL.Core.UI; +using PCL.CE.Core.App; +using PCL.CE.Core.Minecraft; +using PCL.CE.Core.UI; -namespace PCL; +namespace PCL.CE; public partial class PageSetupJava { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml b/PCL.CE/Pages/PageSetup/PageSetupLaunch.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml rename to PCL.CE/Pages/PageSetup/PageSetupLaunch.xaml index 874575afa..f1f98c8fa 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupLaunch.xaml @@ -1,12 +1,12 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupLaunch.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupLaunch.xaml.cs index fe130f3aa..d8ac9b4a2 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLaunch.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupLaunch.xaml.cs @@ -3,10 +3,10 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Threading; -using PCL.Core.App; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils.OS; -namespace PCL; +namespace PCL.CE; public partial class PageSetupLaunch { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml b/PCL.CE/Pages/PageSetup/PageSetupLauncherMisc.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml rename to PCL.CE/Pages/PageSetup/PageSetupLauncherMisc.xaml index 3a23d6d3e..84bc79991 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupLauncherMisc.xaml @@ -1,9 +1,9 @@ diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs index 3bf774429..658c7db3b 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupLauncherMisc.xaml.cs @@ -3,11 +3,11 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using PCL.Core.App; -using PCL.Core.App.Configuration; -using PCL.Core.UI; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Configuration; +using PCL.CE.Core.UI; -namespace PCL; +namespace PCL.CE; public partial class PageSetupLauncherMisc { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLeft.xaml b/PCL.CE/Pages/PageSetup/PageSetupLeft.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLeft.xaml rename to PCL.CE/Pages/PageSetup/PageSetupLeft.xaml index 39e94eaa9..226cb3dae 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLeft.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupLeft.xaml @@ -1,8 +1,8 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLeft.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLeft.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupLeft.xaml.cs index 7369818d9..c4ded317c 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLeft.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupLeft.xaml.cs @@ -1,9 +1,9 @@ using System.Windows; using System.Windows.Controls; using Microsoft.VisualBasic; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageSetupLeft { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLog.xaml b/PCL.CE/Pages/PageSetup/PageSetupLog.xaml similarity index 94% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLog.xaml rename to PCL.CE/Pages/PageSetup/PageSetupLog.xaml index 2fc6c4591..c4ccee74f 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLog.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupLog.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLog.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupLog.xaml.cs similarity index 97% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupLog.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupLog.xaml.cs index 56bd1c292..fe97dc101 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupLog.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupLog.xaml.cs @@ -3,13 +3,13 @@ using System.IO.Compression; using System.Windows; using System.Windows.Input; -using PCL.Core.App; -using PCL.Core.Logging; -using PCL.Core.UI; -using PCL.Core.Utils; -using PCL.Core.Utils.Exts; +using PCL.CE.Core.App; +using PCL.CE.Core.Logging; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils; +using PCL.CE.Core.Utils.Exts; -namespace PCL; +namespace PCL.CE; public partial class PageSetupLog { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml b/PCL.CE/Pages/PageSetup/PageSetupUI.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml rename to PCL.CE/Pages/PageSetup/PageSetupUI.xaml index 064b37f6d..7dfde69d3 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupUI.xaml @@ -1,11 +1,11 @@ diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupUI.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupUI.xaml.cs index 93523c418..8882f0592 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupUI.xaml.cs @@ -4,11 +4,11 @@ using System.Windows.Input; using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; -using PCL.Core.App; -using PCL.Core.UI; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public partial class PageSetupUI { diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUpdate.xaml b/PCL.CE/Pages/PageSetup/PageSetupUpdate.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupUpdate.xaml rename to PCL.CE/Pages/PageSetup/PageSetupUpdate.xaml index 207bfd632..a0f11889d 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUpdate.xaml +++ b/PCL.CE/Pages/PageSetup/PageSetupUpdate.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUpdate.xaml.cs b/PCL.CE/Pages/PageSetup/PageSetupUpdate.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageSetup/PageSetupUpdate.xaml.cs rename to PCL.CE/Pages/PageSetup/PageSetupUpdate.xaml.cs index 2d3463130..299c07dd6 100644 --- a/Plain Craft Launcher 2/Pages/PageSetup/PageSetupUpdate.xaml.cs +++ b/PCL.CE/Pages/PageSetup/PageSetupUpdate.xaml.cs @@ -1,10 +1,10 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using PCL.Core.App; -using PCL.Core.Utils; +using PCL.CE.Core.App; +using PCL.CE.Core.Utils; -namespace PCL; +namespace PCL.CE; public partial class PageSetupUpdate { @@ -34,7 +34,7 @@ private async Task IsLatestAsync() try { // 修复:使用 dynamic 绕过命名空间重名导致的编译期类型冲突, - // 或者你可以尝试替换为 PCL.Core.App.SemVer.Parse(ModBase.VersionBaseName) + // 或者你可以尝试替换为 PCL.CE.Core.App.SemVer.Parse(ModBase.VersionBaseName) if (await ModSecret.RemoteServer.IsLatestAsync( ModSecret.IsCurrentVersionBeta ? UpdateChannel.beta : UpdateChannel.stable, ModBase.IsArm64System ? UpdateArch.arm64 : UpdateArch.x64, diff --git a/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml b/PCL.CE/Pages/PageSpeedLeft.xaml similarity index 97% rename from Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml rename to PCL.CE/Pages/PageSpeedLeft.xaml index 1f1c3504d..b4dc63bf5 100644 --- a/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml +++ b/PCL.CE/Pages/PageSpeedLeft.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.cs b/PCL.CE/Pages/PageSpeedLeft.xaml.cs similarity index 94% rename from Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.cs rename to PCL.CE/Pages/PageSpeedLeft.xaml.cs index 485105bf6..724a17fef 100644 --- a/Plain Craft Launcher 2/Pages/PageSpeedLeft.xaml.cs +++ b/PCL.CE/Pages/PageSpeedLeft.xaml.cs @@ -1,9 +1,9 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Threading; -using PCL.Network; +using PCL.CE.Network; -namespace PCL; +namespace PCL.CE; public partial class PageSpeedLeft { @@ -192,7 +192,7 @@ public void TaskRefresh(ModLoader.LoaderBase Loader) Card.Children.RemoveAt(Row * 2); Card.Children.Insert(Row * 2, (UIElement)ModBase.GetObjectFromXML( - "")); } @@ -206,7 +206,7 @@ public void TaskRefresh(ModLoader.LoaderBase Loader) Card.Children.RemoveAt(Row * 2); Card.Children.Insert(Row * 2, (UIElement)ModBase.GetObjectFromXML( - $"")); + $"")); } else { @@ -223,7 +223,7 @@ public void TaskRefresh(ModLoader.LoaderBase Loader) Card.Children.RemoveAt(Row * 2); Card.Children.Insert(Row * 2, (UIElement)ModBase.GetObjectFromXML( - $"")); + $"")); } break; @@ -257,7 +257,7 @@ public void TaskRefresh(ModLoader.LoaderBase Loader) #region 没有卡片且未中断或完成,添加新的卡片 var CardXAML = $@" - diff --git a/Plain Craft Launcher 2/Pages/PageSpeedRight.xaml b/PCL.CE/Pages/PageSpeedRight.xaml similarity index 96% rename from Plain Craft Launcher 2/Pages/PageSpeedRight.xaml rename to PCL.CE/Pages/PageSpeedRight.xaml index a1775cfb5..0ec9958ac 100644 --- a/Plain Craft Launcher 2/Pages/PageSpeedRight.xaml +++ b/PCL.CE/Pages/PageSpeedRight.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageSpeedRight.xaml.cs b/PCL.CE/Pages/PageSpeedRight.xaml.cs similarity index 92% rename from Plain Craft Launcher 2/Pages/PageSpeedRight.xaml.cs rename to PCL.CE/Pages/PageSpeedRight.xaml.cs index 6e804d750..c2e7a3be1 100644 --- a/Plain Craft Launcher 2/Pages/PageSpeedRight.xaml.cs +++ b/PCL.CE/Pages/PageSpeedRight.xaml.cs @@ -1,4 +1,4 @@ -namespace PCL; +namespace PCL.CE; public partial class PageSpeedRight { diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsGameLink.xaml b/PCL.CE/Pages/PageTools/PageToolsGameLink.xaml similarity index 99% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsGameLink.xaml rename to PCL.CE/Pages/PageTools/PageToolsGameLink.xaml index 2f071a912..da8678c4e 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsGameLink.xaml +++ b/PCL.CE/Pages/PageTools/PageToolsGameLink.xaml @@ -1,8 +1,8 @@ diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsGameLink.xaml.cs b/PCL.CE/Pages/PageTools/PageToolsGameLink.xaml.cs similarity index 98% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsGameLink.xaml.cs rename to PCL.CE/Pages/PageTools/PageToolsGameLink.xaml.cs index 9796ca577..00f64dbde 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsGameLink.xaml.cs +++ b/PCL.CE/Pages/PageTools/PageToolsGameLink.xaml.cs @@ -3,19 +3,19 @@ using System.Windows; using System.Windows.Input; using Newtonsoft.Json.Linq; -using PCL.Core.App; -using PCL.Core.Link; -using PCL.Core.Link.EasyTier; -using PCL.Core.Link.Lobby; -using PCL.Core.Link.McPing; -using PCL.Core.Link.Natayark; -using PCL.Core.Link.Scaffolding.Client.Models; -using PCL.Core.Link.Scaffolding.EasyTier; -using PCL.Core.Logging; -using PCL.Core.Utils.Validate; -using PCL.Network; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.Link; +using PCL.CE.Core.Link.EasyTier; +using PCL.CE.Core.Link.Lobby; +using PCL.CE.Core.Link.McPing; +using PCL.CE.Core.Link.Natayark; +using PCL.CE.Core.Link.Scaffolding.Client.Models; +using PCL.CE.Core.Link.Scaffolding.EasyTier; +using PCL.CE.Core.Logging; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; + +namespace PCL.CE; public partial class PageToolsGameLink { diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsHelp.xaml b/PCL.CE/Pages/PageTools/PageToolsHelp.xaml similarity index 91% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsHelp.xaml rename to PCL.CE/Pages/PageTools/PageToolsHelp.xaml index d553c0c22..fe35ed361 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsHelp.xaml +++ b/PCL.CE/Pages/PageTools/PageToolsHelp.xaml @@ -1,9 +1,9 @@  diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsHelpDetail.xaml.cs b/PCL.CE/Pages/PageTools/PageToolsHelpDetail.xaml.cs similarity index 93% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsHelpDetail.xaml.cs rename to PCL.CE/Pages/PageTools/PageToolsHelpDetail.xaml.cs index 7c9bac823..ff8ff9f98 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsHelpDetail.xaml.cs +++ b/PCL.CE/Pages/PageTools/PageToolsHelpDetail.xaml.cs @@ -1,6 +1,6 @@ using System.Windows; -namespace PCL; +namespace PCL.CE; public partial class PageOtherHelpDetail : IRefreshable { @@ -37,7 +37,7 @@ public bool Init(ModMain.HelpEntry Entry) if (Content.Contains("xmlns")) Content = Content.RegexReplace("xmlns[^\"']*(\"|')[^\"']*(\"|')", "").Replace("xmlns", ""); // 禁止声明命名空间 Content = - $"{Content}"; + $"{Content}"; this.Entry = Entry; PanCustom.Children.Clear(); PanCustom.Children.Add((UIElement)ModBase.GetObjectFromXML(Content)); diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsLeft.xaml b/PCL.CE/Pages/PageTools/PageToolsLeft.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsLeft.xaml rename to PCL.CE/Pages/PageTools/PageToolsLeft.xaml index c9bbf3daf..408a268b9 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsLeft.xaml +++ b/PCL.CE/Pages/PageTools/PageToolsLeft.xaml @@ -1,9 +1,9 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsLeft.xaml.cs b/PCL.CE/Pages/PageTools/PageToolsLeft.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsLeft.xaml.cs rename to PCL.CE/Pages/PageTools/PageToolsLeft.xaml.cs index 18bb0b5fa..32e84e338 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsLeft.xaml.cs +++ b/PCL.CE/Pages/PageTools/PageToolsLeft.xaml.cs @@ -1,8 +1,8 @@ using System.Windows; using System.Windows.Controls; -using PCL.Core.App; +using PCL.CE.Core.App; -namespace PCL; +namespace PCL.CE; public partial class PageToolsLeft { diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsTest.xaml b/PCL.CE/Pages/PageTools/PageToolsTest.xaml similarity index 98% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsTest.xaml rename to PCL.CE/Pages/PageTools/PageToolsTest.xaml index fc00902e7..22d9cca1f 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsTest.xaml +++ b/PCL.CE/Pages/PageTools/PageToolsTest.xaml @@ -1,8 +1,8 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageTools/PageToolsTest.xaml.cs b/PCL.CE/Pages/PageTools/PageToolsTest.xaml.cs similarity index 99% rename from Plain Craft Launcher 2/Pages/PageTools/PageToolsTest.xaml.cs rename to PCL.CE/Pages/PageTools/PageToolsTest.xaml.cs index 68396f8a7..4608a8ce8 100644 --- a/Plain Craft Launcher 2/Pages/PageTools/PageToolsTest.xaml.cs +++ b/PCL.CE/Pages/PageTools/PageToolsTest.xaml.cs @@ -9,18 +9,18 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media.Imaging; -using PCL.Core.App; -using PCL.Core.App.Tools; -using PCL.Core.IO; -using PCL.Core.IO.Net; -using PCL.Core.UI; -using PCL.Core.Utils.OS; -using PCL.Core.Utils.Secret; -using PCL.Core.Utils.Validate; -using PCL.Network; -using PCL.Network.Loaders; - -namespace PCL; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Tools; +using PCL.CE.Core.IO; +using PCL.CE.Core.IO.Net; +using PCL.CE.Core.UI; +using PCL.CE.Core.Utils.OS; +using PCL.CE.Core.Utils.Secret; +using PCL.CE.Core.Utils.Validate; +using PCL.CE.Network; +using PCL.CE.Network.Loaders; + +namespace PCL.CE; public partial class PageToolsTest { diff --git a/Plain Craft Launcher 2/Program.cs b/PCL.CE/Program.cs similarity index 89% rename from Plain Craft Launcher 2/Program.cs rename to PCL.CE/Program.cs index 5bf58b78c..19762871c 100644 --- a/Plain Craft Launcher 2/Program.cs +++ b/PCL.CE/Program.cs @@ -1,11 +1,11 @@ using System.Diagnostics; using System.Windows.Input; -using PCL.Core.App; -using PCL.Core.App.Essentials; -using PCL.Core.App.IoC; -using PCL.Core.Utils.OS; +using PCL.CE.Core.App; +using PCL.CE.Core.App.Essentials; +using PCL.CE.Core.App.IoC; +using PCL.CE.Core.Utils.OS; -namespace PCL; +namespace PCL.CE; internal static class Program { diff --git a/Plain Craft Launcher 2/Resources/Custom.xml b/PCL.CE/Resources/Custom.xml similarity index 99% rename from Plain Craft Launcher 2/Resources/Custom.xml rename to PCL.CE/Resources/Custom.xml index a9693beec..574bfeb1a 100644 --- a/Plain Craft Launcher 2/Resources/Custom.xml +++ b/PCL.CE/Resources/Custom.xml @@ -410,7 +410,7 @@ - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:sys="clr-namespace:System;assembly=mscorlib" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - - xmlns:local="clr-namespace:PCL;assembly=Plain Craft Launcher 2" + - xmlns:local="clr-namespace:PCL.CE;assembly=PCL.CE" 除此之外,不能声明其他命名空间。 --> diff --git a/Plain Craft Launcher 2/Resources/Font.ttf b/PCL.CE/Resources/Font.ttf similarity index 100% rename from Plain Craft Launcher 2/Resources/Font.ttf rename to PCL.CE/Resources/Font.ttf diff --git a/Plain Craft Launcher 2/Resources/Help.zip b/PCL.CE/Resources/Help.zip similarity index 100% rename from Plain Craft Launcher 2/Resources/Help.zip rename to PCL.CE/Resources/Help.zip diff --git a/Plain Craft Launcher 2/Resources/Markdown.xaml b/PCL.CE/Resources/Markdown.xaml similarity index 100% rename from Plain Craft Launcher 2/Resources/Markdown.xaml rename to PCL.CE/Resources/Markdown.xaml diff --git a/Plain Craft Launcher 2/Resources/forge-installer.jar b/PCL.CE/Resources/forge-installer.jar similarity index 100% rename from Plain Craft Launcher 2/Resources/forge-installer.jar rename to PCL.CE/Resources/forge-installer.jar diff --git a/Plain Craft Launcher 2/Resources/hints.txt b/PCL.CE/Resources/hints.txt similarity index 100% rename from Plain Craft Launcher 2/Resources/hints.txt rename to PCL.CE/Resources/hints.txt diff --git a/Plain Craft Launcher 2/Resources/java-wrapper.jar b/PCL.CE/Resources/java-wrapper.jar similarity index 100% rename from Plain Craft Launcher 2/Resources/java-wrapper.jar rename to PCL.CE/Resources/java-wrapper.jar diff --git a/Plain Craft Launcher 2/Resources/linkd.exe b/PCL.CE/Resources/linkd.exe similarity index 100% rename from Plain Craft Launcher 2/Resources/linkd.exe rename to PCL.CE/Resources/linkd.exe diff --git a/Plain Craft Launcher 2/Resources/log4j2-debug.xml b/PCL.CE/Resources/log4j2-debug.xml similarity index 100% rename from Plain Craft Launcher 2/Resources/log4j2-debug.xml rename to PCL.CE/Resources/log4j2-debug.xml diff --git a/Plain Craft Launcher 2/Resources/log4j2-legacy-debug.xml b/PCL.CE/Resources/log4j2-legacy-debug.xml similarity index 100% rename from Plain Craft Launcher 2/Resources/log4j2-legacy-debug.xml rename to PCL.CE/Resources/log4j2-legacy-debug.xml diff --git a/Plain Craft Launcher 2/Resources/lwjgl-unsafe-agent.jar b/PCL.CE/Resources/lwjgl-unsafe-agent.jar similarity index 100% rename from Plain Craft Launcher 2/Resources/lwjgl-unsafe-agent.jar rename to PCL.CE/Resources/lwjgl-unsafe-agent.jar diff --git a/Plain Craft Launcher 2/Resources/mcmod.buf b/PCL.CE/Resources/mcmod.buf similarity index 100% rename from Plain Craft Launcher 2/Resources/mcmod.buf rename to PCL.CE/Resources/mcmod.buf diff --git a/Plain Craft Launcher 2/Resources/oauth-complete.html b/PCL.CE/Resources/oauth-complete.html similarity index 100% rename from Plain Craft Launcher 2/Resources/oauth-complete.html rename to PCL.CE/Resources/oauth-complete.html diff --git a/Plain Craft Launcher 2/Resources/retro-wrapper.jar b/PCL.CE/Resources/retro-wrapper.jar similarity index 100% rename from Plain Craft Launcher 2/Resources/retro-wrapper.jar rename to PCL.CE/Resources/retro-wrapper.jar diff --git a/Plain Craft Launcher 2/Resources/transformer.jar b/PCL.CE/Resources/transformer.jar similarity index 100% rename from Plain Craft Launcher 2/Resources/transformer.jar rename to PCL.CE/Resources/transformer.jar diff --git a/Plain Craft Launcher 2/app.manifest b/PCL.CE/app.manifest similarity index 100% rename from Plain Craft Launcher 2/app.manifest rename to PCL.CE/app.manifest diff --git a/Plain Craft Launcher 2/metadata.json b/PCL.CE/metadata.json similarity index 99% rename from Plain Craft Launcher 2/metadata.json rename to PCL.CE/metadata.json index 4eedc9218..1346fb9b5 100644 --- a/Plain Craft Launcher 2/metadata.json +++ b/PCL.CE/metadata.json @@ -8,9 +8,9 @@ }, "licenses": [ { - "name": "PCL.Core", + "name": "PCL.CE.Core", "info": "Copyright © PCL Community", - "website": "https://github.com/PCL-Community/PCL2-CE/tree/dev/PCL.Core", + "website": "https://github.com/PCL-Community/PCL2-CE/tree/dev/PCL.CE.Core", "license": "https://github.com/PCL-Community/PCL2-CE/blob/dev/LICENSE" }, { diff --git a/PCL.Core/.editorconfig b/PCL.Core/.editorconfig deleted file mode 100644 index 6a3ce59b2..000000000 --- a/PCL.Core/.editorconfig +++ /dev/null @@ -1,177 +0,0 @@ -# PCL.Core 项目级别的编辑器规则 - -[*.cs] - -# 定义符号 - -# 常量 -dotnet_naming_symbols.constants.applicable_kinds = field -dotnet_naming_symbols.constants.applicable_accessibilities = * -dotnet_naming_symbols.constants.required_modifiers = const - -# 局部变量 & 方法/构造函数参数 -dotnet_naming_symbols.local_and_parameter.applicable_kinds = local, parameter -dotnet_naming_symbols.local_and_parameter.applicable_accessibilities = * -dotnet_naming_symbols.local_and_parameter.required_modifiers = - -# 私有实例只读字段 -dotnet_naming_symbols.private_instance_readonly_fields.applicable_kinds = field -dotnet_naming_symbols.private_instance_readonly_fields.applicable_accessibilities = private -dotnet_naming_symbols.private_instance_readonly_fields.required_modifiers = readonly - -# 私有静态只读字段 -dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field -dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private -dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly - -# 私有实例字段(非只读) -dotnet_naming_symbols.private_instance_fields.applicable_kinds = field -dotnet_naming_symbols.private_instance_fields.applicable_accessibilities = private -dotnet_naming_symbols.private_instance_fields.required_modifiers = - -# 私有静态字段(非只读) -dotnet_naming_symbols.private_static_fields.applicable_kinds = field -dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private -dotnet_naming_symbols.private_static_fields.required_modifiers = static - -# 私有实例属性 -dotnet_naming_symbols.private_instance_properties.applicable_kinds = property -dotnet_naming_symbols.private_instance_properties.applicable_accessibilities = private -dotnet_naming_symbols.private_instance_properties.required_modifiers = - -# 私有静态属性 -dotnet_naming_symbols.private_static_properties.applicable_kinds = property -dotnet_naming_symbols.private_static_properties.applicable_accessibilities = private -dotnet_naming_symbols.private_static_properties.required_modifiers = static - -# 其它实例变量(public/internal/protected 的字段、属性、事件) -dotnet_naming_symbols.variables_instance_others.applicable_kinds = field, property, event -dotnet_naming_symbols.variables_instance_others.applicable_accessibilities = public, internal, protected, protected_internal, private_protected -dotnet_naming_symbols.variables_instance_others.required_modifiers = - -# 其它静态变量(public/internal/protected 的字段、属性、事件) -dotnet_naming_symbols.variables_static_others.applicable_kinds = field, property, event -dotnet_naming_symbols.variables_static_others.applicable_accessibilities = public, internal, protected, protected_internal, private_protected -dotnet_naming_symbols.variables_static_others.required_modifiers = static - -# 私有方法(静态+实例) -dotnet_naming_symbols.private_methods.applicable_kinds = method -dotnet_naming_symbols.private_methods.applicable_accessibilities = private -dotnet_naming_symbols.private_methods.required_modifiers = - -# 非私有方法(静态+实例) -dotnet_naming_symbols.non_private_methods.applicable_kinds = method -dotnet_naming_symbols.non_private_methods.applicable_accessibilities = public, internal, protected, protected_internal, private_protected -dotnet_naming_symbols.non_private_methods.required_modifiers = - -# 局部方法(local function) -dotnet_naming_symbols.local_functions.applicable_kinds = local_function -dotnet_naming_symbols.local_functions.applicable_accessibilities = * -dotnet_naming_symbols.local_functions.required_modifiers = - -# 接口 -dotnet_naming_symbols.interfaces.applicable_kinds = interface -dotnet_naming_symbols.interfaces.applicable_accessibilities = * -dotnet_naming_symbols.interfaces.required_modifiers = - -# 其它类型(class, struct, enum, delegate) -dotnet_naming_symbols.other_types.applicable_kinds = class, struct, enum, delegate -dotnet_naming_symbols.other_types.applicable_accessibilities = * -dotnet_naming_symbols.other_types.required_modifiers = - -# 定义命名风格 - -# camelCase -dotnet_naming_style.camel_case_style.capitalization = camel_case - -# PascalCase -dotnet_naming_style.pascal_case_style.capitalization = pascal_case - -# _PascalCase -dotnet_naming_style.underscore_pascal_case_style.capitalization = pascal_case -dotnet_naming_style.underscore_pascal_case_style.required_prefix = _ - -# _camelCase -dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case -dotnet_naming_style.underscore_camel_case_style.required_prefix = _ - -# IPascalCase -dotnet_naming_style.prefix_I_pascal_style.capitalization = pascal_case -dotnet_naming_style.prefix_I_pascal_style.required_prefix = I - -# 绑定命名规则 - -# 常量 应 PascalCase -dotnet_naming_rule.const.symbols = constants -dotnet_naming_rule.const.style = pascal_case_style -dotnet_naming_rule.const.severity = warning - -# 局部变量 & 参数 应 camelCase -dotnet_naming_rule.local_var.symbols = local_and_parameter -dotnet_naming_rule.local_var.style = camel_case_style -dotnet_naming_rule.local_var.severity = warning - -# 私有实例只读字段 应 _camelCase -dotnet_naming_rule.private_readonly_field.symbols = private_instance_readonly_fields -dotnet_naming_rule.private_readonly_field.style = underscore_camel_case_style -dotnet_naming_rule.private_readonly_field.severity = warning - -# 私有静态只读字段 应 _PascalCase -dotnet_naming_rule.private_static_readonly_field.symbols = private_static_readonly_fields -dotnet_naming_rule.private_static_readonly_field.style = underscore_pascal_case_style -dotnet_naming_rule.private_static_readonly_field.severity = warning - -# 私有实例字段 应 _camelCase -dotnet_naming_rule.private_field.symbols = private_instance_fields -dotnet_naming_rule.private_field.style = underscore_camel_case_style -dotnet_naming_rule.private_field.severity = warning - -# 私有静态字段 应 _camelCase -dotnet_naming_rule.private_static_field.symbols = private_static_fields -dotnet_naming_rule.private_static_field.style = underscore_camel_case_style -dotnet_naming_rule.private_static_field.severity = warning - -# 私有实例属性 应 _PascalCase -dotnet_naming_rule.private_property.symbols = private_instance_properties -dotnet_naming_rule.private_property.style = underscore_pascal_case_style -dotnet_naming_rule.private_property.severity = warning - -# 私有静态属性 应 PascalCase -dotnet_naming_rule.private_static_property.symbols = private_static_properties -dotnet_naming_rule.private_static_property.style = pascal_case_style -dotnet_naming_rule.private_static_property.severity = warning - -# 其它实例变量 应 PascalCase -dotnet_naming_rule.field.symbols = variables_instance_others -dotnet_naming_rule.field.style = pascal_case_style -dotnet_naming_rule.field.severity = warning - -# 其它静态变量 应 PascalCase -dotnet_naming_rule.static_field.symbols = variables_static_others -dotnet_naming_rule.static_field.style = pascal_case_style -dotnet_naming_rule.static_field.severity = warning - -# 私有方法 应 _PascalCase -dotnet_naming_rule.private_method.symbols = private_methods -dotnet_naming_rule.private_method.style = underscore_pascal_case_style -dotnet_naming_rule.private_method.severity = warning - -# 非私有方法 应 PascalCase -dotnet_naming_rule.method.symbols = non_private_methods -dotnet_naming_rule.method.style = pascal_case_style -dotnet_naming_rule.method.severity = warning - -# 局部方法 应 PascalCase -dotnet_naming_rule.local_func.symbols = local_functions -dotnet_naming_rule.local_func.style = pascal_case_style -dotnet_naming_rule.local_func.severity = warning - -# 接口 应 IPascalCase -dotnet_naming_rule.interface.symbols = interfaces -dotnet_naming_rule.interface.style = prefix_I_pascal_style -dotnet_naming_rule.interface.severity = warning - -# 其它类型 应 PascalCase -dotnet_naming_rule.type.symbols = other_types -dotnet_naming_rule.type.style = pascal_case_style -dotnet_naming_rule.type.severity = warning diff --git a/PCL.Core/.gitignore b/PCL.Core/.gitignore deleted file mode 100644 index 6a35cb368..000000000 --- a/PCL.Core/.gitignore +++ /dev/null @@ -1,410 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -[Aa][Rr][Mm]64[Ee][Cc]/ -bld/ -[Bb]in/ -[Oo]bj/ -[Oo]ut/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -# but not Directory.Build.rsp, as it configures directory-level build defaults -!Directory.Build.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.tlog -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio 6 auto-generated project file (contains which files were open etc.) -*.vbp - -# Visual Studio 6 workspace and project file (working project files containing files to include in project) -*.dsw -*.dsp - -# Visual Studio 6 technical files -*.ncb -*.aps - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# AWS SAM Build and Temporary Artifacts folder -.aws-sam - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# Visual Studio History (VSHistory) files -.vshistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -# VS Code files for those working on multiple tools -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -# Windows Installer files from build outputs -*.cab -*.msi -*.msix -*.msm -*.msp - -# JetBrains Rider -.idea/ -*.sln.iml - -# Generated Code -**/*.g.cs diff --git a/PCL.Core/IO/Download/NDlScheduler.cs b/PCL.Core/IO/Download/NDlScheduler.cs deleted file mode 100644 index f756cd203..000000000 --- a/PCL.Core/IO/Download/NDlScheduler.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace PCL.Core.IO.Download; - -public class NDlScheduler -{ -} diff --git a/PCL.Core/IO/Download/NDlTask.cs b/PCL.Core/IO/Download/NDlTask.cs deleted file mode 100644 index a4219193a..000000000 --- a/PCL.Core/IO/Download/NDlTask.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace PCL.Core.IO.Download; - -public class NDlTask -{ -} diff --git a/PCL.Core/IO/Download/NDlTaskSegment.cs b/PCL.Core/IO/Download/NDlTaskSegment.cs deleted file mode 100644 index 5f3183770..000000000 --- a/PCL.Core/IO/Download/NDlTaskSegment.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace PCL.Core.IO.Download; - -public class NDlTaskSegment -{ -} diff --git a/PCL.Core/Minecraft/IdentityModel/Extensions/Pkce/PkceChallengeOptions.cs b/PCL.Core/Minecraft/IdentityModel/Extensions/Pkce/PkceChallengeOptions.cs deleted file mode 100644 index 20d39ac80..000000000 --- a/PCL.Core/Minecraft/IdentityModel/Extensions/Pkce/PkceChallengeOptions.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace PCL.Core.Minecraft.IdentityModel.Extensions.Pkce; - -public enum PkceChallengeOptions -{ - Sha256, - PlainText -} \ No newline at end of file diff --git a/PCL.Core/Minecraft/Java/UserPreference/AutoSelect.cs b/PCL.Core/Minecraft/Java/UserPreference/AutoSelect.cs deleted file mode 100644 index 527f4871b..000000000 --- a/PCL.Core/Minecraft/Java/UserPreference/AutoSelect.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace PCL.Core.Minecraft.Java.UserPreference; - -public record AutoSelect : JavaPreference; \ No newline at end of file diff --git a/PCL.Core/Minecraft/Java/UserPreference/UseGlobalPreference.cs b/PCL.Core/Minecraft/Java/UserPreference/UseGlobalPreference.cs deleted file mode 100644 index d350c5b3e..000000000 --- a/PCL.Core/Minecraft/Java/UserPreference/UseGlobalPreference.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace PCL.Core.Minecraft.Java.UserPreference; - -public record UseGlobalPreference : JavaPreference; \ No newline at end of file diff --git a/PCL.Core/NOTICE b/PCL.Core/NOTICE deleted file mode 100644 index 46439a0c9..000000000 --- a/PCL.Core/NOTICE +++ /dev/null @@ -1,16 +0,0 @@ -This product uses the following open source components: - -- SharpZipLib (MIT License) - https://github.com/icsharpcode/SharpZipLib - -- LiteDB (MIT License) - https://github.com/litedb-org/LiteDB - -- Microsoft.Net.Compilers.Toolset (MIT License) - https://github.com/dotnet/roslyn - -- Microsoft.Toolkit.Uwp.Notifications (MIT License) - https://github.com/CommunityToolkit/WindowsCommunityToolkit - -- PolySharp (MIT License) - https://github.com/Sergio0694/PolySharp/ \ No newline at end of file diff --git a/PCL.Core/PCL.Core.csproj b/PCL.Core/PCL.Core.csproj deleted file mode 100644 index 58f63e67b..000000000 --- a/PCL.Core/PCL.Core.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - PCL.Core - PCL.Core - PCL Community 为 PCL 开发的启动器核心库 - PCL Community - PCL.Core - Copyright © PCL Community - 1.0.0.0 - 1.0.0.0 - - - Debug - AnyCPU - Debug;CI;Release;Beta - AnyCPU;x64;ARM64 - {A0C2209D-64FB-4C11-9459-8E86304B6F94} - PCL.Core - net8.0-windows - true - true - true - 14.0 - enable - prompt - 4 - bin\$(Configuration)-$(Platform)\ - $(Platform) - $(NoWarn);CS9113 - - - - true - full - false - DEBUG;TRACE - CI;TRACE - - - none - true - RELEASE;PUBLISH - BETA;PUBLISH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - false - false - false - false - - - - - - - - - - - - - \ No newline at end of file diff --git a/PCL.Core/README.md b/PCL.Core/README.md deleted file mode 100644 index 97f6d27f8..000000000 --- a/PCL.Core/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## ✨ PCL.Core - -这是为 PCL CE 版本特别开发的核心库,由社区开发与维护 - -## 🔒 协议 - -遵循 Apache License 2.0 开源协议 \ No newline at end of file diff --git a/PCL.Core/UI/Animation/Core/IAnimationData.cs b/PCL.Core/UI/Animation/Core/IAnimationData.cs deleted file mode 100644 index 7d8b0b6c4..000000000 --- a/PCL.Core/UI/Animation/Core/IAnimationData.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace PCL.Core.UI.Animation.Core; - -public interface IAnimationData -{ - -} \ No newline at end of file diff --git a/Plain Craft Launcher 2.slnx b/Plain Craft Launcher 2.slnx deleted file mode 100644 index cbe70b35c..000000000 --- a/Plain Craft Launcher 2.slnx +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj b/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj deleted file mode 100644 index 8aa844bcf..000000000 --- a/Plain Craft Launcher 2/Plain Craft Launcher 2.vbproj +++ /dev/null @@ -1,122 +0,0 @@ - - - net8.0-windows - WinExe - PCL - Custom - false - PCL.Program - publish\ - true - true - win-x64 - win-arm64 - true - true - zh-CN - false - true - default - true - Beta;Debug;Release;CI - AnyCPU;x64;ARM64 - enable - app.manifest - Images\icon.ico - Plain Craft Launcher Community Edition - Minecraft 启动器 (作者: 龙腾猫跃; 经社区二次开发版本) - Plain Craft Launcher Community Edition - Copyright © 龙腾猫跃 2016. All Rights Reserved. - 2.14.5.0 - 2.14.5.0 - - 41999;42016;42017;42018;42019;42020;42021;42022;42032;42036;42314; - VSTHRD002;VSTHRD003;VSTHRD110;VSTHRD200 - - - - bin\Debug\ - true - full - false - true - DEBUG - - - bin\CI\ - true - full - false - true - DEBUGCI - - - bin\Release\ - false - none - true - RELEASE - - - bin\Beta\ - false - none - true - BETA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - false - false - false - false - - - - - - - - - - - - - - \ No newline at end of file