Farbpalette vorladen lassen
Bootstraper läd jetzt die farbeinstellung sofort und nicht nachträglich cleanup and rework PDF switch to HTML export fix Colorsystem Farben für knöpfe hinzugefügt als anpassung button color button color primary and secondary change
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Microsoft.Maui.Storage;
|
||||
|
||||
namespace cfs_tracker.Services;
|
||||
|
||||
public class DatabaseLocationService
|
||||
{
|
||||
private const string UseExternalDatabaseKey = "db_use_external";
|
||||
private const string ExternalDatabasePathKey = "db_external_path";
|
||||
|
||||
public bool UseExternalDatabase
|
||||
{
|
||||
get => Preferences.Default.Get(UseExternalDatabaseKey, false);
|
||||
set => Preferences.Default.Set(UseExternalDatabaseKey, value);
|
||||
}
|
||||
|
||||
public string ExternalDatabasePath
|
||||
{
|
||||
get => Preferences.Default.Get(ExternalDatabasePathKey, string.Empty);
|
||||
set => Preferences.Default.Set(ExternalDatabasePathKey, value ?? string.Empty);
|
||||
}
|
||||
|
||||
public string ResolveDatabasePath()
|
||||
{
|
||||
if (UseExternalDatabase)
|
||||
{
|
||||
var configured = (ExternalDatabasePath ?? string.Empty).Trim();
|
||||
if (!string.IsNullOrWhiteSpace(configured))
|
||||
{
|
||||
if (Path.HasExtension(configured))
|
||||
return configured;
|
||||
|
||||
return Path.Combine(configured, "cfs_tracker.db3");
|
||||
}
|
||||
}
|
||||
|
||||
return Path.Combine(FileSystem.Current.AppDataDirectory, "cfs_tracker.db3");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user