mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.290
This commit is contained in:
parent
af3c20ea1c
commit
ad3cdbcadf
231 changed files with 14555 additions and 7798 deletions
|
@ -4,10 +4,9 @@ using Serilog.Events;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services.Geolocation;
|
||||
using TINK.Settings;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
@ -155,14 +154,14 @@ namespace TINK.Model.Settings
|
|||
|
||||
/// <summary> Sets the version of the app. </summary>
|
||||
/// <param name="settingsJSON">Dictionary holding parameters from JSON.</param>
|
||||
public static Dictionary<string, string> SetAppVersion(this IDictionary<string, string> p_oTargetDictionary, Version p_strAppVersion)
|
||||
public static Dictionary<string, string> SetAppVersion(this IDictionary<string, string> targetDictionary, Version appVersion)
|
||||
{
|
||||
if (p_oTargetDictionary == null)
|
||||
if (targetDictionary == null)
|
||||
throw new Exception("Writing copri host uri to dictionary failed. Dictionary must not be null.");
|
||||
|
||||
return p_oTargetDictionary.Union(new Dictionary<string, string>
|
||||
return targetDictionary.Union(new Dictionary<string, string>
|
||||
{
|
||||
{APPVERIONKEY , JsonConvert.SerializeObject(p_strAppVersion, new VersionConverter()) },
|
||||
{APPVERIONKEY , JsonConvert.SerializeObject(appVersion, new VersionConverter()) },
|
||||
}).ToDictionary(key => key.Key, value => value.Value);
|
||||
}
|
||||
|
||||
|
@ -172,16 +171,16 @@ namespace TINK.Model.Settings
|
|||
public static Version GetAppVersion(this IDictionary<string, string> settingsJSON)
|
||||
{
|
||||
// Get the version of the app which wrote the settings file.
|
||||
if (!settingsJSON.TryGetValue(APPVERIONKEY, out string l_oAppVersion)
|
||||
|| string.IsNullOrEmpty(l_oAppVersion))
|
||||
if (!settingsJSON.TryGetValue(APPVERIONKEY, out string appVersion)
|
||||
|| string.IsNullOrEmpty(appVersion))
|
||||
{
|
||||
// File holds no entry.
|
||||
return null;
|
||||
}
|
||||
|
||||
return l_oAppVersion.TrimStart().StartsWith("\"")
|
||||
? JsonConvert.DeserializeObject<Version>(l_oAppVersion, new VersionConverter())
|
||||
: Version.Parse(l_oAppVersion); // Format used up to version 3.0.0.115
|
||||
return appVersion.TrimStart().StartsWith("\"")
|
||||
? JsonConvert.DeserializeObject<Version>(appVersion, new VersionConverter())
|
||||
: Version.Parse(appVersion); // Format used up to version 3.0.0.115
|
||||
}
|
||||
|
||||
|
||||
|
@ -220,21 +219,21 @@ namespace TINK.Model.Settings
|
|||
}
|
||||
|
||||
/// <summary> Saves object to file. </summary>
|
||||
/// <param name="p_SettingsList">Settings to save.</param>
|
||||
public static void Serialize(string p_strSettingsFileFolder, IDictionary<string, string> p_SettingsList)
|
||||
/// <param name="settingsList">Settings to save.</param>
|
||||
public static void Serialize(string settingsFileFolder, IDictionary<string, string> settingsList)
|
||||
{
|
||||
// Save settings to file.
|
||||
var l_oText = JsonConvert.SerializeObject(p_SettingsList, Formatting.Indented);
|
||||
var l_oFolder = p_strSettingsFileFolder;
|
||||
var l_oText = JsonConvert.SerializeObject(settingsList, Formatting.Indented);
|
||||
var l_oFolder = settingsFileFolder;
|
||||
System.IO.File.WriteAllText($"{l_oFolder}{System.IO.Path.DirectorySeparatorChar}{SETTINGSFILETITLE}", l_oText);
|
||||
}
|
||||
|
||||
/// <summary> Gets TINK app settings form xml- file. </summary>
|
||||
/// <param name="p_strSettingsDirectory">Directory to read settings from.</param>
|
||||
/// <param name="settingsDirectory">Directory to read settings from.</param>
|
||||
/// <returns>Dictionary of settings.</returns>
|
||||
public static Dictionary<string, string> Deserialize(string p_strSettingsDirectory)
|
||||
public static Dictionary<string, string> Deserialize(string settingsDirectory)
|
||||
{
|
||||
var l_oFileName = $"{p_strSettingsDirectory}{System.IO.Path.DirectorySeparatorChar}{SETTINGSFILETITLE}";
|
||||
var l_oFileName = $"{settingsDirectory}{System.IO.Path.DirectorySeparatorChar}{SETTINGSFILETITLE}";
|
||||
|
||||
if (!System.IO.File.Exists(l_oFileName))
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using Serilog.Events;
|
||||
using System;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services.Geolocation;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Services.CopriApi.ServerUris;
|
||||
using TINK.Settings;
|
||||
|
@ -18,7 +18,8 @@ namespace TINK.Model.Settings
|
|||
public const bool DEFAULTREPOTLEVEL = false;
|
||||
|
||||
/// <summary> Gets the type of the default geolocation service. </summary>
|
||||
public static Type DefaultLocationService => typeof(GeolocationService);
|
||||
/// <remarks> Swtiched from GeolocationService (GeolocationAccuracyMediumService) to GeolocationAccuracyHighService in app version 3.0.290.</remarks>
|
||||
public static Type DefaultLocationService => typeof(GeolocationAccuracyHighService);
|
||||
|
||||
// Default value of the expires after entry. Controls the expiration time of the cache values.
|
||||
private TimeSpan DEFAULTEXPIRESAFTER = TimeSpan.FromSeconds(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue