| 1 | using CascadeIDE.Contracts; |
| 2 | namespace CascadeIDE.Features.Settings.DataAcquisition; |
| 3 | |
| 4 | /// <summary>DAL: каталог и пути к файлам настроек в %LocalAppData%\CascadeIDE\.</summary> |
| 5 | [IoBoundary] |
| 6 | public static class UserSettingsPaths |
| 7 | { |
| 8 | public static string GetSettingsDirectory() |
| 9 | { |
| 10 | var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); |
| 11 | var dir = Path.Combine(appData, "CascadeIDE"); |
| 12 | if (!Directory.Exists(dir)) |
| 13 | Directory.CreateDirectory(dir); |
| 14 | return dir; |
| 15 | } |
| 16 | |
| 17 | public static string GetSettingsFilePath() => Path.Combine(GetSettingsDirectory(), "settings.toml"); |
| 18 | |
| 19 | public static string GetHotkeysUserFilePath() => |
| 20 | Path.Combine(GetSettingsDirectory(), "hotkeys.toml"); |
| 21 | |
| 22 | public static string GetBundledHotkeysFilePath() => Path.Combine(AppContext.BaseDirectory, "Hotkeys", "hotkeys.toml"); |
| 23 | |
| 24 | public static string GetEditorLanguagesUserFilePath() => |
| 25 | Path.Combine(GetSettingsDirectory(), "editor-languages.toml"); |
| 26 | |
| 27 | public static string GetBundledEditorLanguagesFilePath() => |
| 28 | Path.Combine(AppContext.BaseDirectory, "Settings", "editor-languages.toml"); |
| 29 | } |
| 30 | |
View only · write via MCP/CIDE