- Add Models: Category, ToolItem (IsValid runtime-only, not stored), AppConfig - Add Services: IDataService + JsonDataService (JSON load/save) - Path validation on Load(): File.Exists check, logs warning for missing paths - Startup: auto-calls dataService.Load() to load config
28 lines
631 B
C#
28 lines
631 B
C#
namespace PersonalToolBox.Models;
|
|
|
|
/// <summary>
|
|
/// 应用全局配置,对应 config.json 的顶层结构
|
|
/// </summary>
|
|
public class AppConfig
|
|
{
|
|
/// <summary>
|
|
/// 主题模式 (Dark / Light)
|
|
/// </summary>
|
|
public string Theme { get; set; } = "Dark";
|
|
|
|
/// <summary>
|
|
/// 是否开机自启动
|
|
/// </summary>
|
|
public bool AutoStart { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// 工具分类列表
|
|
/// </summary>
|
|
public List<Category> Categories { get; set; } = new();
|
|
|
|
/// <summary>
|
|
/// 工具项列表
|
|
/// </summary>
|
|
public List<ToolItem> Tools { get; set; } = new();
|
|
}
|