41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using Jugenddienst_Stunden.Interfaces;
|
|
using Jugenddienst_Stunden.Types;
|
|
|
|
namespace Jugenddienst_Stunden.Infrastructure;
|
|
|
|
/// <summary>
|
|
/// Represents the application settings and provides access to user preferences
|
|
/// such as API URL, API key, employee ID, and personal details.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The <c>AppSettings</c> class implements the <c>IAppSettings</c> interface and manages
|
|
/// persistent configuration settings needed for the application.
|
|
/// These settings include preferences like API configuration and user identification details.
|
|
/// </remarks>
|
|
internal sealed class AppSettings : IAppSettings {
|
|
public string ApiUrl {
|
|
get => Preferences.Default.Get("apiUrl", "");
|
|
set => Preferences.Default.Set("apiUrl", value);
|
|
}
|
|
|
|
public string ApiKey {
|
|
get => Preferences.Default.Get("apiKey", "");
|
|
set => Preferences.Default.Set("apiKey", value);
|
|
}
|
|
|
|
public int EmployeeId {
|
|
get => Preferences.Default.Get("EmployeeId", 0);
|
|
set => Preferences.Default.Set("EmployeeId", value);
|
|
}
|
|
|
|
public string Name {
|
|
get => Preferences.Default.Get("name", "Nicht");
|
|
set => Preferences.Default.Set("name", value);
|
|
}
|
|
|
|
public string Surname {
|
|
get => Preferences.Default.Get("surname", "Eingeloggt");
|
|
set => Preferences.Default.Set("surname", value);
|
|
}
|
|
public Settings? Settings { get; set; }
|
|
} |