mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 03:27:29 +02:00
3.0.267 merged
This commit is contained in:
parent
b6fb6394db
commit
67999ef4ae
171 changed files with 6473 additions and 1093 deletions
|
@ -122,13 +122,13 @@ namespace TINK.Model.Connector
|
|||
Log.ForContext<Command>().Error("Unexpected booking request detected. No user logged in.");
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
public async Task<MiniSurveyModel> DoReturn(
|
||||
public async Task<BookingFinishedModel> DoReturn(
|
||||
Bikes.Bike.BluetoothLock.IBikeInfoMutable bike,
|
||||
LocationDto location,
|
||||
ISmartDevice smartDevice)
|
||||
{
|
||||
Log.ForContext<Command>().Error("Unexpected returning request detected. No user logged in.");
|
||||
return await Task.FromResult(new MiniSurveyModel());
|
||||
return await Task.FromResult(new BookingFinishedModel());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace TINK.Model.Connector
|
|||
/// <param name="bike">Bike to return.</param>
|
||||
/// <param name="locaton">Position of the bike.</param>
|
||||
/// <param name="smartDevice">Provides info about hard and software.</param>
|
||||
public async Task<MiniSurveyModel> DoReturn(
|
||||
public async Task<BookingFinishedModel> DoReturn(
|
||||
Bikes.Bike.BluetoothLock.IBikeInfoMutable bike,
|
||||
LocationDto location,
|
||||
ISmartDevice smartDevice)
|
||||
|
@ -258,7 +258,7 @@ namespace TINK.Model.Connector
|
|||
throw new ArgumentNullException("Can not return bike. No bike object available.");
|
||||
}
|
||||
|
||||
ReservationCancelReturnResponse response;
|
||||
DoReturnResponse response;
|
||||
try
|
||||
{
|
||||
response = (await CopriServer.DoReturn(bike.Id, location, smartDevice, bike.OperatorUri)).GetIsReturnBikeResponseOk(bike.Id);
|
||||
|
@ -270,7 +270,7 @@ namespace TINK.Model.Connector
|
|||
}
|
||||
|
||||
bike.Load(Bikes.Bike.BC.NotifyPropertyChangedLevel.None);
|
||||
return response?.Create() ?? new MiniSurveyModel();
|
||||
return response?.Create() ?? new BookingFinishedModel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace TINK.Model.Connector
|
|||
/// <param name="bike">Bike to return.</param>
|
||||
/// <param name="location">Geolocation of lock when returning bike.</param>
|
||||
/// <param name="smartDevice">Provides info about hard and software.</param>
|
||||
Task<MiniSurveyModel> DoReturn(Bikes.Bike.BluetoothLock.IBikeInfoMutable bike, LocationDto geolocation = null, ISmartDevice smartDevice = null);
|
||||
Task<BookingFinishedModel> DoReturn(Bikes.Bike.BluetoothLock.IBikeInfoMutable bike, LocationDto geolocation = null, ISmartDevice smartDevice = null);
|
||||
|
||||
/// <summary> True if connector has access to copri server, false if cached values are used. </summary>
|
||||
bool IsConnected { get; }
|
||||
|
|
|
@ -11,26 +11,26 @@ namespace TINK.Model.Connector
|
|||
{
|
||||
/// <summary>Constructs a copri connector object.</summary>
|
||||
/// <param name="activeUri"> Uri to connect to.</param>
|
||||
/// <param name="userAgent">Holds the name and version of the TINKApp.</param>
|
||||
/// <param name="appContextInfo">Provides app related info (app name and version, merchantid) to pass to COPRI.</param>
|
||||
/// /// <param name="sessionCookie"> Holds the session cookie.</param>
|
||||
/// <param name="p_strMail">Mail of user.</param>
|
||||
/// <param name="expiresAfter">Timespan which holds value after which cache expires.</param>
|
||||
/// <param name="server"> Provides cached addess to copri.</param>
|
||||
public Connector(
|
||||
Uri activeUri,
|
||||
string userAgent,
|
||||
AppContextInfo appContextInfo,
|
||||
string sessionCookie,
|
||||
string mail,
|
||||
TimeSpan? expiresAfter = null,
|
||||
ICachedCopriServer server = null )
|
||||
{
|
||||
Command = GetCommand(
|
||||
server ?? new CopriProviderHttps(activeUri, TinkApp.MerchantId, userAgent, sessionCookie),
|
||||
server ?? new CopriProviderHttps(activeUri, TinkApp.MerchantId, appContextInfo, sessionCookie),
|
||||
sessionCookie,
|
||||
mail);
|
||||
|
||||
Query = GetQuery(
|
||||
server ?? new CopriProviderHttps(activeUri, TinkApp.MerchantId, userAgent, sessionCookie, expiresAfter),
|
||||
server ?? new CopriProviderHttps(activeUri, TinkApp.MerchantId, appContextInfo, sessionCookie, expiresAfter),
|
||||
sessionCookie,
|
||||
mail);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using TINK.Repository;
|
||||
|
||||
namespace TINK.Model.Connector
|
||||
{
|
||||
|
@ -7,12 +8,19 @@ namespace TINK.Model.Connector
|
|||
/// <summary>
|
||||
/// Gets a connector object depending on whether beein onlin or offline.
|
||||
/// </summary>
|
||||
/// <param name="isConnected">True if online, false if offline</param>
|
||||
/// <param name="isConnected">True if online, false if offline. If offline cache connector is returned.</param>
|
||||
/// <param name="appContextInfo">Provides app related info (app name and version, merchantid) to pass to COPRI.</param>
|
||||
/// <returns></returns>
|
||||
public static IConnector Create(bool isConnected, Uri activeUri, string userAgent, string sessionCookie, string mail, TimeSpan? expiresAfter = null)
|
||||
public static IConnector Create(
|
||||
bool isConnected,
|
||||
Uri activeUri,
|
||||
AppContextInfo appContextInfo,
|
||||
string sessionCookie,
|
||||
string mail,
|
||||
TimeSpan? expiresAfter = null)
|
||||
{
|
||||
return isConnected
|
||||
? new Connector(activeUri, userAgent, sessionCookie, mail, expiresAfter: expiresAfter) as IConnector
|
||||
? new Connector(activeUri, appContextInfo, sessionCookie, mail, expiresAfter: expiresAfter) as IConnector
|
||||
: new ConnectorCache(sessionCookie, mail);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
/// Was "Konrad" up to version 3.0.258.
|
||||
/// Specified first: "KN300001" (RG).
|
||||
/// </remarks>
|
||||
public const string FILTERKONRAD = "300101";
|
||||
public const string CITYBIKE = "300103";
|
||||
|
||||
/// <summary> Holds the tink group (Lastenräder).</summary>
|
||||
/// <remarks>
|
||||
/// Was "TINK" up to version 3.0.258.
|
||||
/// Specified first: "KN300029" (RG).
|
||||
/// </remarks>
|
||||
public const string FILTERTINKGENERAL = "300103";
|
||||
public const string CARGOBIKE = "300101";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,8 @@ namespace TINK.Model.Connector
|
|||
var result = await m_oInnerQuery.GetBikesAsync();
|
||||
return new Result<BikeCollection>(
|
||||
result.Source,
|
||||
new BikeCollection(DoFilter(result.Response, Filter)),
|
||||
new BikeCollection(DoFilter(result.Response, Filter)),
|
||||
result.GeneralData,
|
||||
result.Exception);
|
||||
}
|
||||
|
||||
|
@ -78,7 +79,8 @@ namespace TINK.Model.Connector
|
|||
var result = await m_oInnerQuery.GetBikesOccupiedAsync();
|
||||
return new Result<BikeCollection>(
|
||||
result.Source,
|
||||
new BikeCollection(result.Response.ToDictionary(x => x.Id)),
|
||||
new BikeCollection(result.Response.ToDictionary(x => x.Id)),
|
||||
result.GeneralData,
|
||||
result.Exception);
|
||||
}
|
||||
|
||||
|
@ -95,7 +97,8 @@ namespace TINK.Model.Connector
|
|||
var filteredBikesAndStations = new Result<StationsAndBikesContainer>(
|
||||
providerBikesAndStations.Source,
|
||||
new StationsAndBikesContainer(filteredStationsDictionary, filteredBikesDictionary),
|
||||
providerBikesAndStations.Exception); ;
|
||||
providerBikesAndStations.GeneralData,
|
||||
providerBikesAndStations.Exception);
|
||||
|
||||
return filteredBikesAndStations;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace TINK.Model.Connector
|
|||
return new Result<BikeCollection>(
|
||||
result.Source,
|
||||
new BikeCollection(result.Response.ToDictionary(x => x.Id)),
|
||||
result.GeneralData,
|
||||
result.Exception);
|
||||
}
|
||||
|
||||
|
@ -72,6 +73,7 @@ namespace TINK.Model.Connector
|
|||
return new Result<BikeCollection>(
|
||||
result.Source,
|
||||
new BikeCollection(result.Response.ToDictionary(x => x.Id)),
|
||||
result.GeneralData,
|
||||
result.Exception);
|
||||
}
|
||||
|
||||
|
@ -86,6 +88,7 @@ namespace TINK.Model.Connector
|
|||
new StationsAndBikesContainer(
|
||||
new StationDictionary(result.Response.StationsAll.CopriVersion, result.Response.StationsAll.ToDictionary(x => x.Id)),
|
||||
new BikeCollection(result.Response.Bikes.ToDictionary(x => x.Id))),
|
||||
result.GeneralData,
|
||||
result.Exception);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Bike;
|
||||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Repository;
|
||||
using TINK.Services.CopriApi;
|
||||
using BikeInfo = TINK.Model.Bike.BC.BikeInfo;
|
||||
|
||||
namespace TINK.Model.Connector
|
||||
|
@ -39,6 +40,7 @@ namespace TINK.Model.Connector
|
|||
new StationsAndBikesContainer(
|
||||
resultStations.Response.GetStationsAllMutable(),
|
||||
(await server.GetBikesAvailable(true)).Response.GetBikesAvailable()),
|
||||
resultStations.GeneralData,
|
||||
resultStations.Exception);
|
||||
}
|
||||
|
||||
|
@ -51,6 +53,7 @@ namespace TINK.Model.Connector
|
|||
new StationsAndBikesContainer(
|
||||
(await server.GetStations(true)).Response.GetStationsAllMutable(),
|
||||
resultBikes.Response.GetBikesAvailable()),
|
||||
resultBikes.GeneralData,
|
||||
resultBikes.Exception);
|
||||
}
|
||||
|
||||
|
@ -60,7 +63,8 @@ namespace TINK.Model.Connector
|
|||
|
||||
return new Result<StationsAndBikesContainer>(
|
||||
resultStations.Source,
|
||||
new StationsAndBikesContainer(resultStations.Response.GetStationsAllMutable(), resultBikes.Response.GetBikesAvailable()));
|
||||
new StationsAndBikesContainer(resultStations.Response.GetStationsAllMutable(), resultBikes.Response.GetBikesAvailable()),
|
||||
resultStations.GeneralData);
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes occupied. </summary>
|
||||
|
@ -71,7 +75,8 @@ namespace TINK.Model.Connector
|
|||
return new Result<BikeCollection>(
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
await Task.Run(() => new BikeCollection(new Dictionary<string, BikeInfo>())),
|
||||
new System.Exception("Abfrage der reservierten/ gebuchten Räder nicht möglich. Kein Benutzer angemeldet."));
|
||||
new GeneralData(),
|
||||
new Exception("Abfrage der reservierten/ gebuchten Räder nicht möglich. Kein Benutzer angemeldet."));
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes available. </summary>
|
||||
|
@ -80,7 +85,7 @@ namespace TINK.Model.Connector
|
|||
{
|
||||
var result = await server.GetBikesAvailable();
|
||||
server.AddToCache(result);
|
||||
return new Result<BikeCollection>(result.Source, result.Response.GetBikesAvailable(), result.Exception);
|
||||
return new Result<BikeCollection>(result.Source, result.Response.GetBikesAvailable(), result.GeneralData, result.Exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace TINK.Model.Connector
|
|||
(await server.GetBikesOccupied(true)).Response,
|
||||
Mail,
|
||||
DateTimeProvider)),
|
||||
stationsResponse.GeneralData,
|
||||
stationsResponse.Exception);
|
||||
}
|
||||
|
||||
|
@ -61,6 +62,7 @@ namespace TINK.Model.Connector
|
|||
(await server.GetBikesOccupied(true)).Response,
|
||||
Mail,
|
||||
DateTimeProvider)),
|
||||
bikesAvailableResponse.GeneralData,
|
||||
bikesAvailableResponse.Exception);
|
||||
}
|
||||
|
||||
|
@ -78,6 +80,7 @@ namespace TINK.Model.Connector
|
|||
bikesOccupiedResponse.Response,
|
||||
Mail,
|
||||
DateTimeProvider)),
|
||||
bikesOccupiedResponse.GeneralData,
|
||||
bikesOccupiedResponse.Exception);
|
||||
}
|
||||
|
||||
|
@ -98,6 +101,7 @@ namespace TINK.Model.Connector
|
|||
return new Result<StationsAndBikesContainer>(
|
||||
stationsResponse.Source,
|
||||
new StationsAndBikesContainer(stationsMutable, bikesMutable),
|
||||
stationsResponse.GeneralData,
|
||||
exceptions.Length > 0 ? new AggregateException(exceptions) : null);
|
||||
}
|
||||
|
||||
|
@ -107,7 +111,7 @@ namespace TINK.Model.Connector
|
|||
{
|
||||
var result = await server.GetBikesOccupied();
|
||||
server.AddToCache(result);
|
||||
return new Result<BikeCollection>(result.Source, result.Response.GetBikesOccupied(Mail, DateTimeProvider), result.Exception);
|
||||
return new Result<BikeCollection>(result.Source, result.Response.GetBikesOccupied(Mail, DateTimeProvider), result.GeneralData, result.Exception);
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes available and bikes occupied. </summary>
|
||||
|
@ -127,6 +131,7 @@ namespace TINK.Model.Connector
|
|||
(await server.GetBikesOccupied(true)).Response,
|
||||
Mail,
|
||||
DateTimeProvider),
|
||||
l_oBikesAvailableResponse.GeneralData,
|
||||
l_oBikesAvailableResponse.Exception);
|
||||
}
|
||||
|
||||
|
@ -142,6 +147,7 @@ namespace TINK.Model.Connector
|
|||
l_oBikesOccupiedResponse.Response,
|
||||
Mail,
|
||||
DateTimeProvider),
|
||||
l_oBikesOccupiedResponse.GeneralData,
|
||||
l_oBikesOccupiedResponse.Exception);
|
||||
|
||||
}
|
||||
|
@ -153,6 +159,7 @@ namespace TINK.Model.Connector
|
|||
return new Result<BikeCollection>(
|
||||
l_oBikesAvailableResponse.Source,
|
||||
UpdaterJSON.GetBikesAll(l_oBikesAvailableResponse.Response, l_oBikesOccupiedResponse.Response, Mail, DateTimeProvider),
|
||||
l_oBikesAvailableResponse.GeneralData,
|
||||
l_oBikesAvailableResponse.Exception != null || l_oBikesOccupiedResponse.Exception != null ? new AggregateException(new[] { l_oBikesAvailableResponse.Exception, l_oBikesOccupiedResponse.Exception }) : null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Bike;
|
||||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Repository;
|
||||
using TINK.Services.CopriApi;
|
||||
using BikeInfo = TINK.Model.Bike.BC.BikeInfo;
|
||||
|
||||
namespace TINK.Model.Connector
|
||||
|
@ -34,7 +35,8 @@ namespace TINK.Model.Connector
|
|||
|
||||
return new Result<StationsAndBikesContainer>(
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
new StationsAndBikesContainer( stationsAllResponse.GetStationsAllMutable(), bikesAvailableResponse.GetBikesAvailable()));
|
||||
new StationsAndBikesContainer(stationsAllResponse.GetStationsAllMutable(), bikesAvailableResponse.GetBikesAvailable()),
|
||||
stationsAllResponse.GetGeneralData());
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes occupied. </summary>
|
||||
|
@ -45,16 +47,19 @@ namespace TINK.Model.Connector
|
|||
return new Result<BikeCollection>(
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
await Task.Run(() => new BikeCollection(new Dictionary<string, BikeInfo>())),
|
||||
new System.Exception("Abfrage der reservierten/ gebuchten Räder fehlgeschlagen. Kein Benutzer angemeldet."));
|
||||
new GeneralData(),
|
||||
new Exception("Abfrage der reservierten/ gebuchten Räder fehlgeschlagen. Kein Benutzer angemeldet."));
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes occupied. </summary>
|
||||
/// <returns> Collection of bikes. </returns>
|
||||
public async Task<Result<BikeCollection>> GetBikesAsync()
|
||||
{
|
||||
var bikesAvailableResponse = await server.GetBikesAvailableAsync();
|
||||
return new Result<BikeCollection>(
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
(await server.GetBikesAvailableAsync()).GetBikesAvailable());
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
bikesAvailableResponse.GetBikesAvailable(),
|
||||
bikesAvailableResponse.GetGeneralData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,27 +39,31 @@ namespace TINK.Model.Connector
|
|||
typeof(CopriCallsMonkeyStore),
|
||||
new StationsAndBikesContainer(
|
||||
stationResponse.GetStationsAllMutable(),
|
||||
UpdaterJSON.GetBikesAll(bikesAvailableResponse, bikesOccupiedResponse, Mail, DateTimeProvider)));
|
||||
UpdaterJSON.GetBikesAll(bikesAvailableResponse, bikesOccupiedResponse, Mail, DateTimeProvider)),
|
||||
stationResponse.GetGeneralData());
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes occupied. </summary>
|
||||
/// <returns>Collection of bikes.</returns>
|
||||
public async Task<Result<BikeCollection>> GetBikesOccupiedAsync()
|
||||
{
|
||||
var bikesOccupiedResponse = (await server.GetBikesOccupiedAsync());
|
||||
return new Result<BikeCollection>(
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
(await server.GetBikesOccupiedAsync()).GetBikesOccupied(Mail, DateTimeProvider));
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
bikesOccupiedResponse.GetBikesOccupied(Mail, DateTimeProvider),
|
||||
bikesOccupiedResponse.GetGeneralData());
|
||||
}
|
||||
/// <summary> Gets bikes available and bikes occupied. </summary>
|
||||
/// <returns>Collection of bikes.</returns>
|
||||
public async Task<Result<BikeCollection>> GetBikesAsync()
|
||||
{
|
||||
var l_oBikesAvailableResponse = await server.GetBikesAvailableAsync();
|
||||
var l_oBikesOccupiedResponse = await server.GetBikesOccupiedAsync();
|
||||
var bikesAvailableResponse = await server.GetBikesAvailableAsync();
|
||||
var bikesOccupiedResponse = await server.GetBikesOccupiedAsync();
|
||||
|
||||
return new Result<BikeCollection>(
|
||||
typeof(CopriCallsMonkeyStore),
|
||||
UpdaterJSON.GetBikesAll(l_oBikesAvailableResponse, l_oBikesOccupiedResponse, Mail, DateTimeProvider));
|
||||
UpdaterJSON.GetBikesAll(bikesAvailableResponse, bikesOccupiedResponse, Mail, DateTimeProvider),
|
||||
bikesAvailableResponse.GetGeneralData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ using TINK.Model.Station.Operator;
|
|||
using Xamarin.Forms;
|
||||
using System.Linq;
|
||||
using TINK.Model.MiniSurvey;
|
||||
using TINK.Services.CopriApi;
|
||||
|
||||
namespace TINK.Model.Connector
|
||||
{
|
||||
|
@ -78,6 +79,14 @@ namespace TINK.Model.Connector
|
|||
return stations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets general data from COPRI response.
|
||||
/// </summary>
|
||||
/// <param name="response">Response to get data from.</param>
|
||||
/// <returns>General data object initialized form COPRI response.</returns>
|
||||
public static GeneralData GetGeneralData(this ResponseBase response)
|
||||
=> new GeneralData(response.merchant_message, response.GetCopriVersion());
|
||||
|
||||
/// <summary> Gets account object from login response.</summary>
|
||||
/// <param name="merchantId">Needed to extract cookie from autorization response.</param>
|
||||
/// <param name="loginResponse">Response to get session cookie and debug level from.</param>
|
||||
|
@ -512,22 +521,28 @@ namespace TINK.Model.Connector
|
|||
};
|
||||
}
|
||||
|
||||
/// <summary> Creates a survey object from response.</summary>
|
||||
/// <summary> Creates a booking finished object from response.</summary>
|
||||
/// <param name="response">Response to create survey object from.</param>
|
||||
public static MiniSurveyModel Create(this ReservationCancelReturnResponse response)
|
||||
public static BookingFinishedModel Create(this DoReturnResponse response)
|
||||
{
|
||||
if (response?.user_miniquery == null)
|
||||
var bookingFinished = new BookingFinishedModel
|
||||
{
|
||||
return new MiniSurveyModel();
|
||||
Co2Saving = response?.co2saving
|
||||
};
|
||||
|
||||
if (response?.user_miniquery == null)
|
||||
|
||||
{
|
||||
return bookingFinished;
|
||||
}
|
||||
|
||||
var miniquery = response.user_miniquery;
|
||||
var survey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
bookingFinished.MiniSurvey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
|
||||
foreach (var question in miniquery?.questions?.OrderBy(x => x.Key) ?? new Dictionary<string, MiniSurveyResponse.Question>().OrderBy(x => x.Key))
|
||||
{
|
||||
|
@ -538,12 +553,12 @@ namespace TINK.Model.Connector
|
|||
continue;
|
||||
}
|
||||
|
||||
survey.Questions.Add(
|
||||
bookingFinished.MiniSurvey.Questions.Add(
|
||||
question.Key,
|
||||
new MiniSurveyModel.QuestionModel());
|
||||
}
|
||||
|
||||
return survey;
|
||||
return bookingFinished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace TINK.Model
|
|||
get
|
||||
{
|
||||
return new GroupFilterSettings(new Dictionary<string, FilterState> {
|
||||
{ FilterHelper.FILTERTINKGENERAL, FilterState.On },
|
||||
{FilterHelper.FILTERKONRAD, FilterState.On }
|
||||
{ FilterHelper.CARGOBIKE, FilterState.On },
|
||||
{FilterHelper.CITYBIKE, FilterState.On }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ namespace TINK.Model
|
|||
get
|
||||
{
|
||||
return new GroupFilterMapPage(new Dictionary<string, FilterState> {
|
||||
{ FilterHelper.FILTERTINKGENERAL, FilterState.On },
|
||||
{FilterHelper.FILTERKONRAD, FilterState.Off }
|
||||
{ FilterHelper.CARGOBIKE, FilterState.On },
|
||||
{FilterHelper.CITYBIKE, FilterState.Off }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
namespace TINK.Model.MiniSurvey
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds mini survey.
|
||||
/// </summary>
|
||||
public class MiniSurveyModel
|
||||
{
|
||||
public enum Type
|
||||
|
@ -12,21 +15,17 @@ namespace TINK.Model.MiniSurvey
|
|||
}
|
||||
public class QuestionModel
|
||||
{
|
||||
public QuestionModel()
|
||||
{
|
||||
PossibleAnswers = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds the query description.
|
||||
/// </summary>
|
||||
public string Text { get; set; }
|
||||
|
||||
public Type Type { get; set; }
|
||||
|
||||
public Dictionary<string, string> PossibleAnswers { get; private set; }
|
||||
}
|
||||
|
||||
public MiniSurveyModel()
|
||||
{
|
||||
Questions = new Dictionary<string, QuestionModel>();
|
||||
/// <summary>
|
||||
/// Holds the collection of possible answers.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> PossibleAnswers { get; private set; } = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
public string Title { get; set; }
|
||||
|
@ -35,6 +34,6 @@ namespace TINK.Model.MiniSurvey
|
|||
|
||||
public string Footer { get; set; }
|
||||
|
||||
public Dictionary<string, QuestionModel> Questions { get; }
|
||||
public Dictionary<string, QuestionModel> Questions { get; } = new Dictionary<string, QuestionModel>();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,16 +215,8 @@ namespace TINK.Model
|
|||
GeolocationServices = geolocationServicesContainer
|
||||
?? throw new ArgumentException($"Can not instantiate {nameof(TinkApp)}- object. No geolocation services container object available.");
|
||||
|
||||
if (settings.ActiveUri == new Uri(CopriServerUriList.TINK_LIVE) ||
|
||||
settings.ActiveUri == new Uri(CopriServerUriList.TINK_DEVEL))
|
||||
{
|
||||
FilterGroupSetting = settings.GroupFilterSettings;
|
||||
GroupFilterMapPage = settings.GroupFilterMapPage;
|
||||
} else
|
||||
{
|
||||
FilterGroupSetting = new GroupFilterSettings();
|
||||
GroupFilterMapPage = new GroupFilterMapPage();
|
||||
}
|
||||
FilterGroupSetting = settings.GroupFilterSettings;
|
||||
GroupFilterMapPage = settings.GroupFilterMapPage;
|
||||
|
||||
CenterMapToCurrentLocation = settings.CenterMapToCurrentLocation;
|
||||
|
||||
|
|
|
@ -455,9 +455,29 @@ namespace TINK.Model
|
|||
AppResources.ChangeLog3_0_250 // Third-party components updated.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 257),
|
||||
new Version(3, 0, 260),
|
||||
// Same info as for version 3.0.251 and 3.0.252
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 263),
|
||||
AppResources.ChangeLog3_0_263
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 264),
|
||||
AppResources.ChangeLog3_0_264
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 265),
|
||||
AppResources.ChangeLog3_0_265
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 266),
|
||||
AppResources.ChangeLog3_0_266
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 267),
|
||||
AppResources.ChangeLog3_0_231 // Minor improvements.
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue