d11f0e46c0
clean up and fixes - Heute gefixt - Code Cleanup NotificationScheduleItemViewModel -fixed NotificationScheduleItemViewModel for Windows compat push implementation Push fixes Push benachrichtungen eingebaut - Status bei push - Push auch in background - Toggle für symtome angepasst push system change exporter update Optionen fix - Optionen aufgeteilt auf 3 tabs - Anpassungen haben jetzt Farbslider Optimierung fix
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
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");
|
|
}
|
|
}
|