工具路径为exe时默认显示exe自身图标

ToolItem新增IsExePath计算属性,ExePathToIconConverter通过Icon.ExtractAssociatedIcon提取exe图标并缓存,卡片模板图标区改为三层优先级:FontAwesome > exe图标 > 首字母
This commit is contained in:
2026-05-10 14:26:55 +08:00
parent f33c89d2c4
commit e126184973
4 changed files with 86 additions and 3 deletions

View File

@@ -62,4 +62,12 @@ public class ToolItem
/// 是否在软件启动时自动运行
/// </summary>
public bool AutoRunOnStart { get; set; }
/// <summary>
/// 路径是否指向 .exe 文件(仅运行时判断,不存入 JSON
/// </summary>
[JsonIgnore]
public bool IsExePath =>
!IsGroup && !string.IsNullOrWhiteSpace(ExecutablePath) &&
ExecutablePath.EndsWith(".exe", StringComparison.OrdinalIgnoreCase);
}