mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-02 20:56:23 +01:00
Split Settings into model, serializer, paths and store
698 lines did all of it at once. The mutable CaptureFromUi callback becomes an ISettingsCapture the settings view implements.
This commit is contained in:
20
StarterNG/Application/Abstractions/IEnvironment.cs
Normal file
20
StarterNG/Application/Abstractions/IEnvironment.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace StarterNG.Application.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// The bits of the host machine the starter has to ask about: which operating
|
||||
/// system it is on, and where that system keeps per-user configuration.
|
||||
/// </summary>
|
||||
public interface IEnvironment
|
||||
{
|
||||
bool IsWindows { get; }
|
||||
|
||||
bool IsLinux { get; }
|
||||
|
||||
bool IsMacOS { get; }
|
||||
|
||||
/// <summary>An environment variable, or null when it is not set.</summary>
|
||||
string? GetVariable(string name);
|
||||
|
||||
/// <summary>The folder the starter's own executable lives in.</summary>
|
||||
string BaseDirectory { get; }
|
||||
}
|
||||
@@ -58,4 +58,10 @@ public interface IFileSystem
|
||||
IReadOnlyList<string> GetFilesRecursive(string path, string searchPattern);
|
||||
|
||||
DateTime GetLastWriteTimeUtc(string path);
|
||||
|
||||
/// <summary>
|
||||
/// Whether the file carries an execute bit. Always true on Windows, where
|
||||
/// executability is a property of the file's contents rather than its mode.
|
||||
/// </summary>
|
||||
bool IsExecutable(string path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user