Rename projects to FileShare
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using FileShare_Services.Core;
|
||||
using FileShare_Services.Endpoints;
|
||||
using FileShare_Services.Extensions;
|
||||
using FileShare_Services.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FileShare_PC.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// MainWindow 的分部类,负责路由注册和统一端点适配。
|
||||
/// </summary>
|
||||
public partial class MainWindow
|
||||
{
|
||||
/// <summary>
|
||||
/// 统一端点适配器(替代原来的 _routes 字典)。
|
||||
/// 所有端点在 FileShare-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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user