mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +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;
|
||||
|
|
|
@ -15,6 +15,9 @@ namespace TINK.Model.State
|
|||
/// <param name="p_eValue">State value.</param>
|
||||
protected BaseState(InUseStateEnum p_eValue) {}
|
||||
|
||||
/// <summary>
|
||||
/// Holds the state value.
|
||||
/// </summary>
|
||||
public abstract InUseStateEnum Value { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace TINK.Model.State
|
|||
/// </summary>
|
||||
public class StateInfo : IStateInfo
|
||||
{
|
||||
// Holds the current disposable state value
|
||||
// Holds the current disposable state value.
|
||||
private readonly BaseState m_oInUseState;
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -6,14 +6,14 @@ namespace TINK.Model.Station
|
|||
{
|
||||
private const double PRECISSION_LATITUDE_LONGITUDE = 0.000000000000001;
|
||||
|
||||
public Position()
|
||||
public Position()
|
||||
{
|
||||
}
|
||||
|
||||
public Position(double p_dLatitude, double p_dLongitude)
|
||||
public Position(double latitude, double longitude)
|
||||
{
|
||||
Latitude = p_dLatitude;
|
||||
Longitude = p_dLongitude;
|
||||
Latitude = latitude;
|
||||
Longitude = longitude;
|
||||
}
|
||||
|
||||
public double Latitude { get; private set; }
|
||||
|
@ -35,7 +35,6 @@ namespace TINK.Model.Station
|
|||
|
||||
return Math.Abs(Latitude - l_oTarget.Latitude) < PRECISSION_LATITUDE_LONGITUDE
|
||||
&& Math.Abs(Longitude - l_oTarget.Longitude) < PRECISSION_LATITUDE_LONGITUDE;
|
||||
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
|
|
|
@ -193,7 +193,11 @@ namespace TINK.Model
|
|||
LocksServices.SetTimeOut(settings.ConnectTimeout);
|
||||
|
||||
Themes = new ServicesContainerMutable<object>(
|
||||
new HashSet<object> { new Themes.Konrad() , new Themes.ShareeBike() },
|
||||
new HashSet<object> {
|
||||
new Themes.Konrad(),
|
||||
new Themes.ShareeBike(),
|
||||
new Themes.LastenradBayern()
|
||||
},
|
||||
settings.ActiveTheme);
|
||||
|
||||
GeolocationServices = geolocationServicesContainer
|
||||
|
@ -204,11 +208,6 @@ namespace TINK.Model
|
|||
{
|
||||
FilterGroupSetting = settings.GroupFilterSettings;
|
||||
GroupFilterMapPage = settings.GroupFilterMapPage;
|
||||
//} else if (settings.ActiveUri == new Uri(CopriServerUriList.SHAREE_LIVE) ||
|
||||
// settings.ActiveUri == new Uri(CopriServerUriList.SHAREE_DEVEL))
|
||||
//{
|
||||
// FilterGroupSetting = new GroupFilterSettings(new Dictionary<string, FilterState> { { "300001", FilterState.On }, { "300029", FilterState.On } });
|
||||
// FilterGroupMapPage = new GroupFilterMapPage();
|
||||
} else
|
||||
{
|
||||
FilterGroupSetting = new GroupFilterSettings();
|
||||
|
@ -269,7 +268,11 @@ namespace TINK.Model
|
|||
WhatsNew = new WhatsNew(AppVersion, lastVersion, whatsNewShownInVersion);
|
||||
|
||||
if (Themes.Active.GetType().FullName == typeof(Themes.ShareeBike).FullName)
|
||||
{
|
||||
// Nothing to do.
|
||||
// Theme to activate is default theme.
|
||||
return;
|
||||
}
|
||||
|
||||
// Set active app theme
|
||||
ICollection<ResourceDictionary> mergedDictionaries = Application.Current.Resources.MergedDictionaries;
|
||||
|
@ -284,6 +287,10 @@ namespace TINK.Model
|
|||
if (Themes.Active.GetType().FullName == typeof(Themes.Konrad).FullName)
|
||||
{
|
||||
mergedDictionaries.Add(new Themes.Konrad());
|
||||
}
|
||||
else if (Themes.Active.GetType().FullName == typeof(Themes.LastenradBayern).FullName)
|
||||
{
|
||||
mergedDictionaries.Add(new Themes.LastenradBayern());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -50,24 +50,24 @@ namespace TINK.Model.User.Account
|
|||
public class Account : IAccount
|
||||
{
|
||||
/// <summary> Constructs an account object.</summary>
|
||||
/// <param name="mail">Mail addresss.</param>
|
||||
/// <param name="mail">Mail address of the account holder.</param>
|
||||
/// <param name="password">Password.</param>
|
||||
/// <param name="sessionCookie">Session cookie from copri.</param>
|
||||
/// <param name="group">Group holdig info about Group (TINK, Konrad, ...)</param>
|
||||
/// <param name="bikeGroup">Group holdig info about Group (TINK, Konrad, ...)</param>
|
||||
/// <param name="p_iDebugLevel">Flag which controls display of debug settings.</param>
|
||||
public Account(
|
||||
string mail,
|
||||
string password,
|
||||
string sessionCookie,
|
||||
IEnumerable<string> group,
|
||||
IEnumerable<string> bikeGroup,
|
||||
Permissions debugLevel = Permissions.None)
|
||||
{
|
||||
Mail = mail;
|
||||
Pwd = password;
|
||||
SessionCookie = sessionCookie;
|
||||
DebugLevel = debugLevel;
|
||||
Group = group != null
|
||||
? new HashSet<string>(group).ToList()
|
||||
Group = bikeGroup != null
|
||||
? new HashSet<string>(bikeGroup).ToList()
|
||||
: throw new ArgumentException("Can not instantiate account object. Reference to group list must not be empty.");
|
||||
}
|
||||
|
||||
|
@ -75,10 +75,10 @@ namespace TINK.Model.User.Account
|
|||
{
|
||||
}
|
||||
|
||||
/// <summary>Mail address.</summary>
|
||||
/// <summary>Mail address of the account holder.</summary>
|
||||
public string Mail { get; }
|
||||
|
||||
/// <summary>Password of the account.</summary>
|
||||
/// <summary>Password of to authenticate.</summary>
|
||||
public string Pwd { get; }
|
||||
|
||||
/// <summary>Session cookie used to sign in to copri.</summary>
|
||||
|
|
|
@ -429,6 +429,35 @@ namespace TINK.Model
|
|||
{
|
||||
new Version(3, 0, 244),
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 245),
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 246),
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 247),
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 248),
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 249),
|
||||
AppResources.ChangeLog3_0_249 // Third-party components updated.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 250),
|
||||
AppResources.ChangeLog3_0_250 // Third-party components updated.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 254),
|
||||
// Same info as for version 3.0.251 and 3.0.252
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue