- 为全部 5 个项目(Avalonia-API、Avalonia-Common、Avalonia-EFCore、 Avalonia-PC、Avalonia-Services)中缺失注释的类、方法、属性、字段、 接口成员等补全中文 XML 文档注释 - 共修改约 37 个文件,补全约 220+ 处注释 - 修复 ServiceEndpointCollection.cs 中 MapDelete<TService> 语法错误 - 修复 PcAuthService.cs 中 const prefix 位置错乱导致编译失败的问题 - 扫描结果:缺失项 0 - 构建结果:4/4 项目编译通过
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Avalonia_Services.Core;
|
|
using Avalonia_Services.Endpoints;
|
|
using Avalonia_Services.Extensions;
|
|
using Avalonia_Services.Services;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Avalonia_PC.Views
|
|
{
|
|
/// <summary>
|
|
/// MainWindow 的分部类,负责路由注册和统一端点适配。
|
|
/// </summary>
|
|
public partial class MainWindow
|
|
{
|
|
/// <summary>
|
|
/// 统一端点适配器(替代原来的 _routes 字典)。
|
|
/// 所有端点在 Avalonia-Services/AppEndpoints.cs 中统一定义。
|
|
/// </summary>
|
|
private DesktopEndpointAdapter _endpointAdapter = null!;
|
|
|
|
/// <summary>
|
|
/// 服务容器,通过构造函数注入。
|
|
/// </summary>
|
|
private IServiceProvider _services = null!;
|
|
|
|
/// <summary>
|
|
/// 从 DI 获取统一端点集合并构建桌面适配器。
|
|
/// </summary>
|
|
private void RegisterRoutes()
|
|
{
|
|
// 从 DI 获取已构建的端点集合
|
|
var endpointCollection = _services.GetRequiredService<ServiceEndpointCollection>();
|
|
_endpointAdapter = endpointCollection.CreateAdapter(_services);
|
|
}
|
|
}
|
|
}
|