csharpdeeb25a2 | 1 | namespace CascadeIDE.Services; |
| 2 | |
| 3 | /// <summary>JSON-темы из <c>Themes/*.json</c> (не settings.toml).</summary> |
| 4 | public static class SettingsThemeCatalog |
| 5 | { |
| 6 | public sealed record ThemeFileEntry(string DisplayName, string FullPath); |
| 7 | |
| 8 | public static IReadOnlyList<ThemeFileEntry> DiscoverBundled() |
| 9 | { |
| 10 | var dir = Path.Combine(AppContext.BaseDirectory, "Themes"); |
| 11 | if (!Directory.Exists(dir)) |
| 12 | return []; |
| 13 | |
| 14 | return Directory.EnumerateFiles(dir, "*.json", SearchOption.TopDirectoryOnly) |
| 15 | .Select(p => new ThemeFileEntry(Path.GetFileName(p), CanonicalFilePath.Normalize(p))) |
| 16 | .OrderBy(e => e.DisplayName, StringComparer.OrdinalIgnoreCase) |
| 17 | .ToList(); |
| 18 | } |
| 19 | } |
| 20 | |
View only · write via MCP/CIDE