From 87e11449f1bcf7a4b514c2e4489a2a3759a063aa Mon Sep 17 00:00:00 2001
From: GeWuYou <95328647+GeWuYou@users.noreply.github.com>
Date: Tue, 27 Jan 2026 12:35:44 +0800
Subject: [PATCH] =?UTF-8?q?refactor(core):=20=E7=A7=BB=E9=99=A4=E9=9A=90?=
=?UTF-8?q?=E5=BC=8Fusing=E5=B9=B6=E7=BB=9F=E4=B8=80=E5=85=A8=E5=B1=80usin?=
=?UTF-8?q?g=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在多个核心类文件中移除System命名空间的重复using声明
- 创建GlobalUsings.cs文件集中管理公共命名空间引用
- 将System、System.Collections.Generic、System.Linq、System.Threading.Tasks设为全局using
- 禁用项目级别的隐式using功能以提高代码可读性
- 优化项目配置中的包引用格式添加必要的空格
---
GFramework.Core/GFramework.Core.csproj | 4 ++--
GFramework.Core/GlobalUsings.cs | 17 +++++++++++++++++
GFramework.Core/coroutine/CoroutineHelper.cs | 1 +
.../coroutine/instructions/AsyncOperation.cs | 1 +
.../instructions/WaitForAllCoroutines.cs | 3 +--
GFramework.Core/ioc/IocContainer.cs | 1 +
6 files changed, 23 insertions(+), 4 deletions(-)
create mode 100644 GFramework.Core/GlobalUsings.cs
diff --git a/GFramework.Core/GFramework.Core.csproj b/GFramework.Core/GFramework.Core.csproj
index 7edefe5..eb54995 100644
--- a/GFramework.Core/GFramework.Core.csproj
+++ b/GFramework.Core/GFramework.Core.csproj
@@ -3,10 +3,10 @@
GeWuYou.$(AssemblyName)
net8.0;net9.0;net10.0
- enable
+ disable
enable
-
+
diff --git a/GFramework.Core/GlobalUsings.cs b/GFramework.Core/GlobalUsings.cs
new file mode 100644
index 0000000..e44a261
--- /dev/null
+++ b/GFramework.Core/GlobalUsings.cs
@@ -0,0 +1,17 @@
+// Copyright (c) 2025 GeWuYou
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+global using System;
+global using System.Collections.Generic;
+global using System.Linq;
+global using System.Threading.Tasks;
\ No newline at end of file
diff --git a/GFramework.Core/coroutine/CoroutineHelper.cs b/GFramework.Core/coroutine/CoroutineHelper.cs
index 4417784..7e65929 100644
--- a/GFramework.Core/coroutine/CoroutineHelper.cs
+++ b/GFramework.Core/coroutine/CoroutineHelper.cs
@@ -1,3 +1,4 @@
+using System.Threading;
using GFramework.Core.Abstractions.coroutine;
using GFramework.Core.coroutine.instructions;
diff --git a/GFramework.Core/coroutine/instructions/AsyncOperation.cs b/GFramework.Core/coroutine/instructions/AsyncOperation.cs
index 73f7fb5..91732e5 100644
--- a/GFramework.Core/coroutine/instructions/AsyncOperation.cs
+++ b/GFramework.Core/coroutine/instructions/AsyncOperation.cs
@@ -1,4 +1,5 @@
using System.Runtime.CompilerServices;
+using System.Threading;
using GFramework.Core.Abstractions.coroutine;
namespace GFramework.Core.coroutine.instructions;
diff --git a/GFramework.Core/coroutine/instructions/WaitForAllCoroutines.cs b/GFramework.Core/coroutine/instructions/WaitForAllCoroutines.cs
index 0a5b007..fceb997 100644
--- a/GFramework.Core/coroutine/instructions/WaitForAllCoroutines.cs
+++ b/GFramework.Core/coroutine/instructions/WaitForAllCoroutines.cs
@@ -1,5 +1,4 @@
-
-using GFramework.Core.Abstractions.coroutine;
+using GFramework.Core.Abstractions.coroutine;
namespace GFramework.Core.coroutine.instructions;
diff --git a/GFramework.Core/ioc/IocContainer.cs b/GFramework.Core/ioc/IocContainer.cs
index aecfb4e..c4cd341 100644
--- a/GFramework.Core/ioc/IocContainer.cs
+++ b/GFramework.Core/ioc/IocContainer.cs
@@ -1,3 +1,4 @@
+using System.Threading;
using GFramework.Core.Abstractions.ioc;
using GFramework.Core.Abstractions.logging;
using GFramework.Core.Abstractions.system;