Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions App/Configuration/ConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public sealed partial class ConfigService : GeneralService
/// 本地配置文件路径。
/// </summary>
public static string LocalConfigPath { get; } = Path.Combine(FileService.DataPath, "config.v1.yml");

/// <summary>
/// 自定义主页文件路径。
/// </summary>
public static string CustomPagePath { get; } = Path.Combine(FileService.DataPath, "Custom_CE.xaml");

#region Getters & Setters

Expand Down Expand Up @@ -192,6 +197,21 @@ private static void _InitializeProviders()
return trafficCenter;
}
};
},
() => // custom page file
{
// try migrate
if (!File.Exists(CustomPagePath))
{
_TryMigrate(CustomPagePath, [
new ConfigMigration
{
From = Path.Combine(FileService.DataPath, "Custom.xaml"),
To = CustomPagePath,
OnMigration = XamlMigration
}
]);
}
}
];
try { Task.WaitAll(inits.Select(Task.Run).ToArray()); }
Expand All @@ -202,6 +222,10 @@ void SharedJsonMigration(string from, string to)
{
File.Copy(from, to);
}
void XamlMigration(string from, string to)
{
File.Copy(from, to);
}
void CatIniMigration(string from, string to)
{
var lines = File.ReadAllLines(from);
Expand Down
Loading