using System.Diagnostics.CodeAnalysis; using StabilityMatrix.Core.Models.FileInterfaces; namespace StabilityMatrix.Core.Models; [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public static class GlobalConfig { private static DirectoryPath? libraryDir; /// /// Absolute path to the library directory. /// Needs to be set by SettingsManager.TryFindLibrary() before being accessed. /// /// public static DirectoryPath LibraryDir { get { if (libraryDir is null) { throw new NullReferenceException( "GlobalConfig.LibraryDir was not set before being accessed."); } return libraryDir; } set => libraryDir = value; } /// /// Full path to the %APPDATA% directory. /// Usually C:\Users\{username}\AppData\Roaming /// public static DirectoryPath AppDataDir { get; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); /// /// Full path to the fixed home directory. /// Currently %APPDATA%\StabilityMatrix /// public static DirectoryPath HomeDir { get; } = AppDataDir.JoinDir("StabilityMatrix"); }