mirror of
https://github.com/tuxdotrs/highminded.git
synced 2025-08-23 08:01:03 +05:30
refactor: cleaup and implemented mvvm
This commit is contained in:
@@ -4,27 +4,17 @@ using System.Text.Json;
|
||||
|
||||
namespace highminded.utils;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
public string Model { get; set; }
|
||||
public string ApiURL { get; set; }
|
||||
public string ApiKey { get; set; }
|
||||
public string ScreenshotPrompt { get; set; }
|
||||
public string AudioPrompt { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class SettingsManager<T> where T : class, new()
|
||||
{
|
||||
private readonly string _settingsPath;
|
||||
public T Settings { get; internal set; }
|
||||
|
||||
public SettingsManager(string appName = "highminded")
|
||||
public SettingsManager()
|
||||
{
|
||||
_settingsPath = Path.Combine(Environment.CurrentDirectory, "settings.json");
|
||||
Settings = Load();
|
||||
}
|
||||
|
||||
_settingsPath = Path.Combine(Environment.CurrentDirectory, "settings.json");
|
||||
Settings = Load();
|
||||
}
|
||||
|
||||
private T Load()
|
||||
{
|
||||
if (!File.Exists(_settingsPath))
|
||||
|
Reference in New Issue
Block a user