mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 03:04:29 +08:00
- 在 ArchitectureServices 中添加 SetContext 和 GetContext 方法 - 为 IArchitectureServices 接口添加 IContextAware 继承 - 在架构初始化过程中设置服务上下文 - 将事件系统的 GetEvent 方法替换为 GetOrAddEvent 方法 - 重构测试类添加测试装置和拆卸逻辑 - 为测试类添加 NonParallelizable 特性确保测试隔离
25 lines
710 B
C#
25 lines
710 B
C#
using GFramework.Core.Abstractions.architecture;
|
|
using GFramework.Core.Abstractions.events;
|
|
using GFramework.Core.Abstractions.ioc;
|
|
using GFramework.Core.events;
|
|
using GFramework.Core.ioc;
|
|
|
|
namespace GFramework.Core.architecture;
|
|
|
|
public class ArchitectureServices : IArchitectureServices
|
|
{
|
|
private IArchitectureContext _context = null!;
|
|
public IIocContainer Container { get; } = new IocContainer();
|
|
public ITypeEventSystem TypeEventSystem { get; } = new TypeEventSystem();
|
|
|
|
public void SetContext(IArchitectureContext context)
|
|
{
|
|
_context = context;
|
|
Container.SetContext(context);
|
|
}
|
|
|
|
public IArchitectureContext GetContext()
|
|
{
|
|
return _context;
|
|
}
|
|
} |