forked from BeyondDimension/SteamTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
700 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
System.Application.SteamTools.Client.Desktop.Avalonia.App/Startup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System.Application.Models; | ||
using System.Application.Services.Implementation; | ||
using System.Application.UI.ViewModels; | ||
|
||
namespace System.Application.UI | ||
{ | ||
internal static class Startup | ||
{ | ||
public static void Init() | ||
{ | ||
FileSystemDesktop.InitFileSystem(); | ||
ModelValidatorProvider.Init(); | ||
DI.Init(ConfigureServices); | ||
} | ||
|
||
static void ConfigureServices(IServiceCollection services) | ||
{ | ||
// 添加日志实现 | ||
services.AddDesktopLogging(); | ||
|
||
// 模型验证框架 | ||
services.TryAddModelValidator(); | ||
|
||
//var options = AppClientAttribute.Get<AppSettings>(); | ||
var options = new AppSettings | ||
{ | ||
//AppSecretVisualStudioAppCenter = "", | ||
}; | ||
// app 配置项 | ||
services.TryAddOptions(options); | ||
|
||
// 键值对存储 | ||
services.TryAddStorage(); | ||
|
||
// 业务平台用户管理 | ||
services.TryAddUserManager(); | ||
|
||
// 服务端API调用 | ||
services.TryAddCloudServiceClient<CloudServiceClient>(); | ||
|
||
// 桌面平台服务 此项放在其他通用业务实现服务之前 | ||
services.AddDesktopPlatformService(); | ||
|
||
// 本地化服务 | ||
services.AddLocalizationService(); | ||
|
||
// 主线程助手类(MainThreadDesktop) | ||
services.AddMainThreadPlatformService(); | ||
|
||
// 模型视图组 | ||
services.AddViewModelCollectionService(); | ||
services.AddViewModel<MainWindowViewModel>(); | ||
services.AddViewModel<SettingsPageViewModel>(); | ||
|
||
// 业务用户配置文件服务 | ||
services.AddConfigFileService(); | ||
|
||
// hosts 文件助手服务 | ||
services.AddHostsFileService(); | ||
|
||
// 通用 Http 服务 | ||
services.AddHttpService(); | ||
|
||
// Steam 相关助手、工具类服务 | ||
services.AddSteamService(); | ||
|
||
// Steamworks LocalApi Service | ||
services.TryAddSteamworksLocalApiService(); | ||
|
||
// SteamDb WebApi Service | ||
services.AddSteamDbWebApiService(); | ||
|
||
// Steamworks WebApi Service | ||
services.AddSteamworksWebApiService(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.