mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.255
This commit is contained in:
parent
db9c288584
commit
5a26bf273b
1495 changed files with 159465 additions and 5060 deletions
|
@ -110,7 +110,7 @@ namespace TINK.Model.Settings
|
|||
}).ToDictionary(key => key.Key, value => value.Value);
|
||||
}
|
||||
/// <summary> Sets the uri of the active copri host. </summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
/// <param name="settingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
public static Dictionary<string, string> SetCopriHostUri(this IDictionary<string, string> p_oTargetDictionary, string p_strNextActiveUriText)
|
||||
{
|
||||
if (p_oTargetDictionary == null)
|
||||
|
@ -123,11 +123,11 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Gets the timeout to apply when connecting to bluetooth lock.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get information from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get information from.</param>
|
||||
/// <returns>Connect timeout value.</returns>
|
||||
public static TimeSpan? GetConnectTimeout(Dictionary<string, string> p_oSettingsJSON)
|
||||
public static TimeSpan? GetConnectTimeout(Dictionary<string, string> settingsJSON)
|
||||
{
|
||||
if (!p_oSettingsJSON.TryGetValue(CONNECTTIMEOUT, out string connectTimeout)
|
||||
if (!settingsJSON.TryGetValue(CONNECTTIMEOUT, out string connectTimeout)
|
||||
|| string.IsNullOrEmpty(connectTimeout))
|
||||
{
|
||||
// File holds no entry.
|
||||
|
@ -159,7 +159,7 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Sets the version of the app. </summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
/// <param name="settingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
public static Dictionary<string, string> SetAppVersion(this IDictionary<string, string> p_oTargetDictionary, Version p_strAppVersion)
|
||||
{
|
||||
if (p_oTargetDictionary == null)
|
||||
|
@ -172,12 +172,12 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Gets the app versions.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <returns>Logging level</returns>
|
||||
public static Version GetAppVersion(this IDictionary<string, string> p_oSettingsJSON)
|
||||
public static Version GetAppVersion(this IDictionary<string, string> settingsJSON)
|
||||
{
|
||||
// Get the version of the app which wrote the settings file.
|
||||
if (!p_oSettingsJSON.TryGetValue(APPVERIONKEY, out string l_oAppVersion)
|
||||
if (!settingsJSON.TryGetValue(APPVERIONKEY, out string l_oAppVersion)
|
||||
|| string.IsNullOrEmpty(l_oAppVersion))
|
||||
{
|
||||
// File holds no entry.
|
||||
|
@ -191,7 +191,7 @@ namespace TINK.Model.Settings
|
|||
|
||||
|
||||
/// <summary> Sets whether polling is on or off and the periode if polling is on. </summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to write entries to.</param>
|
||||
/// <param name="settingsJSON">Dictionary to write entries to.</param>
|
||||
public static Dictionary<string, string> SetPollingParameters(this IDictionary<string, string> p_oTargetDictionary, PollingParameters p_oPollingParameter)
|
||||
{
|
||||
if (p_oTargetDictionary == null)
|
||||
|
@ -205,13 +205,13 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Get whether polling is on or off and the periode if polling is on. </summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
/// <param name="settingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
/// <returns>Polling parameters.</returns>
|
||||
public static PollingParameters GetPollingParameters(this IDictionary<string, string> p_oSettingsJSON)
|
||||
public static PollingParameters GetPollingParameters(this IDictionary<string, string> settingsJSON)
|
||||
{
|
||||
// Check if dictionary contains entry for periode.
|
||||
if (p_oSettingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(TimeSpan).Name}", out string l_strPeriode)
|
||||
&& p_oSettingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(bool).Name}", out string l_strIsActive)
|
||||
if (settingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(TimeSpan).Name}", out string l_strPeriode)
|
||||
&& settingsJSON.TryGetValue($"{typeof(PollingParameters).Name}_{typeof(bool).Name}", out string l_strIsActive)
|
||||
&& !string.IsNullOrEmpty(l_strPeriode)
|
||||
&& !string.IsNullOrEmpty(l_strIsActive))
|
||||
{
|
||||
|
@ -260,13 +260,13 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Gets the logging level.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <returns>Logging level.</returns>
|
||||
public static LogEventLevel? GetMinimumLoggingLevel(
|
||||
Dictionary<string, string> p_oSettingsJSON)
|
||||
Dictionary<string, string> settingsJSON)
|
||||
{
|
||||
// Get logging level.
|
||||
if (!p_oSettingsJSON.TryGetValue(MINLOGGINGLEVELKEY, out string l_strLevel)
|
||||
if (!settingsJSON.TryGetValue(MINLOGGINGLEVELKEY, out string l_strLevel)
|
||||
|| string.IsNullOrEmpty(l_strLevel))
|
||||
{
|
||||
// File holds no entry.
|
||||
|
@ -281,13 +281,13 @@ namespace TINK.Model.Settings
|
|||
public static bool? GetIsReportLevelVerbose(Dictionary<string, string> settingsJSON) => GetNullableEntry<bool>(ISREPORTLEVELVERBOSEKEY, settingsJSON);
|
||||
|
||||
/// <summary> Sets a value indicating whether report level is verbose or not.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get value from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get value from.</param>
|
||||
public static Dictionary<string, string> SetIsReportLevelVerbose(this IDictionary<string, string> targetDictionary, bool isReportLevelVerbose)
|
||||
=> SetEntry(isReportLevelVerbose, ISREPORTLEVELVERBOSEKEY, targetDictionary);
|
||||
|
||||
|
||||
/// <summary> Sets the logging level.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get logging level from.</param>
|
||||
public static Dictionary<string, string> SetMinimumLoggingLevel(this IDictionary<string, string> p_oTargetDictionary, LogEventLevel p_oLevel)
|
||||
{
|
||||
// Set logging level.
|
||||
|
@ -301,12 +301,12 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Gets the version of app when whats new was shown.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get logging level from.</param>
|
||||
/// <returns>Version of the app.</returns>
|
||||
public static Version GetWhatsNew(Dictionary<string, string> p_oSettingsJSON)
|
||||
public static Version GetWhatsNew(Dictionary<string, string> settingsJSON)
|
||||
{
|
||||
// Get logging level.
|
||||
if (!p_oSettingsJSON.TryGetValue(SHOWWHATSNEWKEY, out string l_strWhatsNewVersion)
|
||||
if (!settingsJSON.TryGetValue(SHOWWHATSNEWKEY, out string l_strWhatsNewVersion)
|
||||
|| string.IsNullOrEmpty(l_strWhatsNewVersion))
|
||||
{
|
||||
// File holds no entry.
|
||||
|
@ -317,7 +317,7 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Sets the version of app when whats new was shown.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get information from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get information from.</param>
|
||||
public static Dictionary<string, string> SetWhatsNew(this IDictionary<string, string> p_oTargetDictionary, Version p_oAppVersion)
|
||||
{
|
||||
// Set logging level.
|
||||
|
@ -331,11 +331,11 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Gets the expires after value.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get expries after value from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get expries after value from.</param>
|
||||
/// <returns>Expires after value.</returns>
|
||||
public static TimeSpan? GetExpiresAfter(Dictionary<string, string> p_oSettingsJSON)
|
||||
public static TimeSpan? GetExpiresAfter(Dictionary<string, string> settingsJSON)
|
||||
{
|
||||
if (!p_oSettingsJSON.TryGetValue(EXPIRESAFTER, out string expiresAfter)
|
||||
if (!settingsJSON.TryGetValue(EXPIRESAFTER, out string expiresAfter)
|
||||
|| string.IsNullOrEmpty(expiresAfter))
|
||||
{
|
||||
// File holds no entry.
|
||||
|
@ -346,7 +346,7 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Sets the the expiration time.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to write information to.</param>
|
||||
/// <param name="settingsJSON">Dictionary to write information to.</param>
|
||||
public static Dictionary<string, string> SetExpiresAfter(this IDictionary<string, string> p_oTargetDictionary, TimeSpan expiresAfter)
|
||||
{
|
||||
if (p_oTargetDictionary == null)
|
||||
|
@ -429,7 +429,7 @@ namespace TINK.Model.Settings
|
|||
public static bool? GetCenterMapToCurrentLocation(Dictionary<string, string> settingsJSON) => GetNullableEntry<bool>(CENTERMAPTOCURRENTLOCATION, settingsJSON);
|
||||
|
||||
/// <summary> Sets a value indicating whether to center the map to location or not.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get value from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get value from.</param>
|
||||
public static Dictionary<string, string> SetCenterMapToCurrentLocation(this IDictionary<string, string> targetDictionary, bool centerMapToCurrentLocation)
|
||||
=> SetEntry(centerMapToCurrentLocation, CENTERMAPTOCURRENTLOCATION, targetDictionary);
|
||||
|
||||
|
@ -446,7 +446,7 @@ namespace TINK.Model.Settings
|
|||
public static bool? GetIsSiteCachingOn(Dictionary<string, string> settingsJSON) => GetNullableEntry<bool>(ISSITECACHINGON, settingsJSON);
|
||||
|
||||
/// <summary> Sets whether to store logging data on SD card or not.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get value from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get value from.</param>
|
||||
public static Dictionary<string, string> SetLogToExternalFolder(this IDictionary<string, string> targetDictionary, bool useSdCard) => SetEntry(useSdCard, LOGTOEXTERNALFOLDER, targetDictionary);
|
||||
|
||||
/// <summary> Sets active theme.</summary>
|
||||
|
@ -454,7 +454,7 @@ namespace TINK.Model.Settings
|
|||
public static Dictionary<string, string> SetActiveTheme(this IDictionary<string, string> targetDictionary, string theme) => SetEntry(theme, THEMEKEY, targetDictionary);
|
||||
|
||||
/// <summary> Sets whether site caching is on or off.</summary>
|
||||
/// <param name="p_oSettingsJSON">Dictionary to get value from.</param>
|
||||
/// <param name="settingsJSON">Dictionary to get value from.</param>
|
||||
public static Dictionary<string, string> SetIsSiteCachingOn(this IDictionary<string, string> targetDictionary, bool useSdCard) => SetEntry(useSdCard, ISSITECACHINGON, targetDictionary);
|
||||
|
||||
/// <summary> Gets the map page filter. </summary>
|
||||
|
|
|
@ -16,6 +16,9 @@ namespace TINK.Model.Settings
|
|||
public const LogEventLevel DEFAULTLOGGINLEVEL = LogEventLevel.Error;
|
||||
|
||||
public const bool DEFAULTREPOTLEVEL = false;
|
||||
|
||||
/// <summary> Gets the type of the default geolocation service. </summary>
|
||||
public static Type DefaultLocationService => typeof(GeolocationService);
|
||||
|
||||
// Default value of the expires after entry. Controls the expiration time of the cache values.
|
||||
private TimeSpan DEFAULTEXPIRESAFTER = TimeSpan.FromSeconds(1);
|
||||
|
@ -56,7 +59,7 @@ namespace TINK.Model.Settings
|
|||
ExpiresAfter = expiresAfter ?? DEFAULTEXPIRESAFTER;
|
||||
ActiveLockService = activeLockService ?? LocksServicesContainerMutable.DefaultLocksservice;
|
||||
ConnectTimeout = connectTimeout ?? new TimeSpan(0, 0, TimeOutProvider.DEFAULT_BLUETOOTHCONNECT_TIMEOUTSECONDS); // Try one sec. to connect.
|
||||
ActiveGeolocationService = activeGeolocationService ?? typeof(LastKnownGeolocationService).Name;
|
||||
ActiveGeolocationService = activeGeolocationService ?? DefaultLocationService.Name;
|
||||
CenterMapToCurrentLocation = centerMapToCurrentLocation ?? GetCenterMapToCurrentLocation(activeUri);
|
||||
LogToExternalFolder = logToExternalFolder ?? false;
|
||||
IsSiteCachingOn = isSiteCachingOn ?? true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue