156 lines
4.3 KiB
C#
156 lines
4.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.Json.Serialization;
|
|
using System.Threading.Tasks;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
namespace gehGassiApp.Domain.Common
|
|
{
|
|
/// <summary>
|
|
/// Rerpäsentiert App-Einstellungen die in den Preferences gespeichert werden
|
|
/// </summary>
|
|
public class AppSettings : ObservableObject
|
|
{
|
|
private bool _reminderWalks;
|
|
private bool _reminderSittings;
|
|
private bool _reminderDayCare;
|
|
private bool _sendCrashReports;
|
|
private bool _reminderVibration;
|
|
private bool _reminderPlaySound;
|
|
|
|
[JsonPropertyName("fakeGps")]
|
|
public bool FakeGps { get; set; }
|
|
|
|
[JsonPropertyName("latitude")]
|
|
public double Latitude { get; set; }
|
|
|
|
[JsonPropertyName("longitude")]
|
|
public double Longitude { get; set; }
|
|
|
|
[JsonPropertyName("logConnection")]
|
|
public bool LogConnection { get; set; }
|
|
|
|
[JsonPropertyName("showDebugView")]
|
|
public bool ShowDebugView { get; set; }
|
|
|
|
[JsonPropertyName("reminderWalks")]
|
|
public bool ReminderWalks
|
|
{
|
|
get => _reminderWalks;
|
|
set
|
|
{
|
|
if (value == _reminderWalks) return;
|
|
_reminderWalks = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
[JsonPropertyName("reminderWalksStart")]
|
|
public int ReminderWalksStart { get; set; }
|
|
[JsonPropertyName("reminderWalksEnd")]
|
|
public int ReminderWalksEnd { get; set; }
|
|
|
|
[JsonPropertyName("reminderSittings")]
|
|
public bool ReminderSittings
|
|
{
|
|
get => _reminderSittings;
|
|
set
|
|
{
|
|
if (value == _reminderSittings) return;
|
|
_reminderSittings = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
[JsonPropertyName("reminderSittingsStart")]
|
|
public int ReminderSittingsStart { get; set; }
|
|
[JsonPropertyName("reminderSittingsEnd")]
|
|
public int ReminderSittingsEnd { get; set; }
|
|
|
|
[JsonPropertyName("reminderDayCare")]
|
|
public bool ReminderDayCare
|
|
{
|
|
get => _reminderDayCare;
|
|
set
|
|
{
|
|
if (value == _reminderDayCare) return;
|
|
_reminderDayCare = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
[JsonPropertyName("reminderDayCareStart")]
|
|
public int ReminderDayCareStart { get; set; }
|
|
[JsonPropertyName("reminderDayCareEnd")]
|
|
public int ReminderDayCareEnd { get; set; }
|
|
|
|
|
|
[JsonPropertyName("sendCrashReports")]
|
|
public bool SendCrashReports
|
|
{
|
|
get => _sendCrashReports;
|
|
set
|
|
{
|
|
if (value == _sendCrashReports) return;
|
|
_sendCrashReports = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
[JsonPropertyName("reminderVibration")]
|
|
public bool ReminderVibration
|
|
{
|
|
get => _reminderVibration;
|
|
set
|
|
{
|
|
if (value == _reminderVibration) return;
|
|
_reminderVibration = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
[JsonPropertyName("reminderPlaySound")]
|
|
public bool ReminderPlaySound
|
|
{
|
|
get => _reminderPlaySound;
|
|
set
|
|
{
|
|
if (value == _reminderPlaySound) return;
|
|
_reminderPlaySound = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Erstellt eine Instanz
|
|
/// </summary>
|
|
public AppSettings()
|
|
{
|
|
FakeGps = false;
|
|
Latitude = 0;
|
|
Longitude = 0;
|
|
LogConnection = false;
|
|
ShowDebugView = false;
|
|
|
|
ReminderWalks = true;
|
|
ReminderWalksStart = 15;
|
|
ReminderWalksEnd = 15;
|
|
|
|
ReminderSittings = true;
|
|
ReminderSittingsStart = 60;
|
|
ReminderSittingsEnd = 60;
|
|
|
|
ReminderDayCare = true;
|
|
ReminderDayCareStart = 60;
|
|
ReminderDayCareEnd = 60;
|
|
|
|
ReminderVibration = true;
|
|
ReminderPlaySound = true;
|
|
|
|
SendCrashReports = true; //TODO: Umstellen wenn nicht mehr in BETA
|
|
}
|
|
}
|
|
}
|