mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -3,21 +3,21 @@ using TINK.Model.Station.Operator;
|
|||
|
||||
namespace TINK.Model.Station
|
||||
{
|
||||
public interface IStation
|
||||
{
|
||||
/// <summary> Holds the unique id of the station.c</summary>
|
||||
string Id { get; }
|
||||
public interface IStation
|
||||
{
|
||||
/// <summary> Holds the unique id of the station.c</summary>
|
||||
string Id { get; }
|
||||
|
||||
/// <summary> Holds the group to which the station belongs.</summary>
|
||||
IEnumerable<string> Group { get; }
|
||||
/// <summary> Holds the group to which the station belongs.</summary>
|
||||
IEnumerable<string> Group { get; }
|
||||
|
||||
/// <summary> Gets the name of the station.</summary>
|
||||
string StationName { get; }
|
||||
/// <summary> Gets the name of the station.</summary>
|
||||
string StationName { get; }
|
||||
|
||||
/// <summary> Holds the gps- position of the station.</summary>
|
||||
IPosition Position { get; }
|
||||
/// <summary> Holds the gps- position of the station.</summary>
|
||||
IPosition Position { get; }
|
||||
|
||||
/// <summary> Holds operator related data.</summary>
|
||||
IData OperatorData { get; }
|
||||
}
|
||||
/// <summary> Holds operator related data.</summary>
|
||||
IData OperatorData { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,22 +3,22 @@ using TINK.Model.Station.Operator;
|
|||
|
||||
namespace TINK.Model.Station
|
||||
{
|
||||
/// <summary> Holds object representing null station.</summary>
|
||||
public class NullStation : IStation
|
||||
{
|
||||
/// <summary> Holds the unique id of the station.c</summary>
|
||||
public string Id => null;
|
||||
/// <summary> Holds object representing null station.</summary>
|
||||
public class NullStation : IStation
|
||||
{
|
||||
/// <summary> Holds the unique id of the station.c</summary>
|
||||
public string Id => null;
|
||||
|
||||
/// <summary> Holds the group to which the station belongs.</summary>
|
||||
public IEnumerable<string> Group => new List<string>();
|
||||
/// <summary> Holds the group to which the station belongs.</summary>
|
||||
public IEnumerable<string> Group => new List<string>();
|
||||
|
||||
/// <summary> Gets the name of the station.</summary>
|
||||
public string StationName => string.Empty;
|
||||
/// <summary> Gets the name of the station.</summary>
|
||||
public string StationName => string.Empty;
|
||||
|
||||
/// <summary> Holds the gps- position of the station.</summary>
|
||||
public IPosition Position => PositionFactory.Create();
|
||||
/// <summary> Holds the gps- position of the station.</summary>
|
||||
public IPosition Position => PositionFactory.Create();
|
||||
|
||||
/// <summary> Holds operator related data.</summary>
|
||||
public IData OperatorData => new Data();
|
||||
}
|
||||
/// <summary> Holds operator related data.</summary>
|
||||
public IData OperatorData => new Data();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,35 +2,35 @@
|
|||
|
||||
namespace TINK.Model.Station.Operator
|
||||
{
|
||||
/// <summary> Holds operator related data.</summary>
|
||||
public class Data : IData
|
||||
{
|
||||
public Data(
|
||||
string name = null,
|
||||
string phoneNumberText = null,
|
||||
string hours = null,
|
||||
string mailAddressText = null, Color? color = null)
|
||||
{
|
||||
Name = name ?? string.Empty;
|
||||
PhoneNumberText = phoneNumberText ?? string.Empty;
|
||||
Hours = hours ?? string.Empty;
|
||||
MailAddressText = mailAddressText ?? string.Empty;
|
||||
Color = color;
|
||||
}
|
||||
/// <summary> Holds operator related data.</summary>
|
||||
public class Data : IData
|
||||
{
|
||||
public Data(
|
||||
string name = null,
|
||||
string phoneNumberText = null,
|
||||
string hours = null,
|
||||
string mailAddressText = null, Color? color = null)
|
||||
{
|
||||
Name = name ?? string.Empty;
|
||||
PhoneNumberText = phoneNumberText ?? string.Empty;
|
||||
Hours = hours ?? string.Empty;
|
||||
MailAddressText = mailAddressText ?? string.Empty;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
/// <summary> Name of the operator.</summary>
|
||||
public string Name { get; private set; }
|
||||
/// <summary> Name of the operator.</summary>
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary> Support phone number of the operator.</summary>
|
||||
public string PhoneNumberText { get; private set; }
|
||||
/// <summary> Support phone number of the operator.</summary>
|
||||
public string PhoneNumberText { get; private set; }
|
||||
|
||||
/// <summary> Office times when support is available.</summary>
|
||||
public string Hours { get; private set; }
|
||||
/// <summary> Office times when support is available.</summary>
|
||||
public string Hours { get; private set; }
|
||||
|
||||
/// <summary> Support mails address of the operator.</summary>
|
||||
public string MailAddressText { get; private set; }
|
||||
/// <summary> Support mails address of the operator.</summary>
|
||||
public string MailAddressText { get; private set; }
|
||||
|
||||
/// <summary> Color of the operator (operator specific skin)</summary>
|
||||
public Color? Color { get; private set; }
|
||||
}
|
||||
/// <summary> Color of the operator (operator specific skin)</summary>
|
||||
public Color? Color { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
namespace TINK.Model.Station.Operator
|
||||
{
|
||||
public interface IData
|
||||
{
|
||||
/// <summary> Name of the operator.</summary>
|
||||
string Name { get; }
|
||||
public interface IData
|
||||
{
|
||||
/// <summary> Name of the operator.</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary> Support phone number of the operator.</summary>
|
||||
string PhoneNumberText { get; }
|
||||
/// <summary> Support phone number of the operator.</summary>
|
||||
string PhoneNumberText { get; }
|
||||
|
||||
/// <summary> Office times when support is available.</summary>
|
||||
string Hours { get; }
|
||||
/// <summary> Office times when support is available.</summary>
|
||||
string Hours { get; }
|
||||
|
||||
/// <summary> Support mails address of the operator.</summary>
|
||||
string MailAddressText { get; }
|
||||
/// <summary> Support mails address of the operator.</summary>
|
||||
string MailAddressText { get; }
|
||||
|
||||
/// <summary> Color of the operator (operator specific skin)</summary>
|
||||
Color? Color { get; }
|
||||
}
|
||||
/// <summary> Color of the operator (operator specific skin)</summary>
|
||||
Color? Color { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,41 +4,41 @@ using TINK.Model.Station.Operator;
|
|||
|
||||
namespace TINK.Model.Station
|
||||
{
|
||||
/// <summary> Holds station info. </summary>
|
||||
public class Station : IStation
|
||||
{
|
||||
/// <summary> Constructs a station object.</summary>
|
||||
/// <param name="id">Id of the station.</param>
|
||||
/// <param name="group">Group (TINK, Konrad) to which station is related.</param>
|
||||
/// <param name="position">GPS- position of the station.</param>
|
||||
/// <param name="stationName">Name of the station.</param>
|
||||
public Station(
|
||||
string id,
|
||||
IEnumerable<string> group,
|
||||
IPosition position,
|
||||
string stationName = "",
|
||||
Data operatorData = null)
|
||||
{
|
||||
Id = id;
|
||||
Group = group ?? throw new ArgumentException("Can not construct station object. Group of stations must not be null.");
|
||||
Position = position;
|
||||
StationName = stationName ?? string.Empty;
|
||||
OperatorData = operatorData ?? new Data();
|
||||
}
|
||||
/// <summary> Holds station info. </summary>
|
||||
public class Station : IStation
|
||||
{
|
||||
/// <summary> Constructs a station object.</summary>
|
||||
/// <param name="id">Id of the station.</param>
|
||||
/// <param name="group">Group (TINK, Konrad) to which station is related.</param>
|
||||
/// <param name="position">GPS- position of the station.</param>
|
||||
/// <param name="stationName">Name of the station.</param>
|
||||
public Station(
|
||||
string id,
|
||||
IEnumerable<string> group,
|
||||
IPosition position,
|
||||
string stationName = "",
|
||||
Data operatorData = null)
|
||||
{
|
||||
Id = id;
|
||||
Group = group ?? throw new ArgumentException("Can not construct station object. Group of stations must not be null.");
|
||||
Position = position;
|
||||
StationName = stationName ?? string.Empty;
|
||||
OperatorData = operatorData ?? new Data();
|
||||
}
|
||||
|
||||
/// <summary> Holds the unique id of the station.c</summary>
|
||||
public string Id { get; }
|
||||
/// <summary> Holds the unique id of the station.c</summary>
|
||||
public string Id { get; }
|
||||
|
||||
/// <summary> Holds the group to which the station belongs.</summary>
|
||||
public IEnumerable<string> Group { get; }
|
||||
/// <summary> Holds the group to which the station belongs.</summary>
|
||||
public IEnumerable<string> Group { get; }
|
||||
|
||||
/// <summary> Gets the name of the station.</summary>
|
||||
public string StationName { get; }
|
||||
/// <summary> Gets the name of the station.</summary>
|
||||
public string StationName { get; }
|
||||
|
||||
/// <summary> Holds the gps- position of the station.</summary>
|
||||
public IPosition Position { get; }
|
||||
/// <summary> Holds the gps- position of the station.</summary>
|
||||
public IPosition Position { get; }
|
||||
|
||||
/// <summary> Holds operator related info.</summary>
|
||||
public IData OperatorData { get; }
|
||||
}
|
||||
/// <summary> Holds operator related info.</summary>
|
||||
public IData OperatorData { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,94 +4,94 @@ using System.Collections.Generic;
|
|||
|
||||
namespace TINK.Model.Station
|
||||
{
|
||||
public class StationDictionary : IEnumerable<IStation>
|
||||
{
|
||||
/// <summary> Holds the list of stations. </summary>
|
||||
private readonly IDictionary<string, IStation> m_oStationDictionary;
|
||||
public class StationDictionary : IEnumerable<IStation>
|
||||
{
|
||||
/// <summary> Holds the list of stations. </summary>
|
||||
private readonly IDictionary<string, IStation> m_oStationDictionary;
|
||||
|
||||
/// <summary> Count of stations. </summary>
|
||||
public int Count { get { return m_oStationDictionary.Count; } }
|
||||
/// <summary> Count of stations. </summary>
|
||||
public int Count { get { return m_oStationDictionary.Count; } }
|
||||
|
||||
public Version CopriVersion { get; }
|
||||
public Version CopriVersion { get; }
|
||||
|
||||
/// <summary> Constructs a station dictionary object. </summary>
|
||||
/// <param name="p_oVersion">Version of copri- service.</param>
|
||||
public StationDictionary(Version p_oVersion = null, IDictionary<string, IStation> p_oStations = null)
|
||||
{
|
||||
m_oStationDictionary = p_oStations ?? new Dictionary<string, IStation>();
|
||||
/// <summary> Constructs a station dictionary object. </summary>
|
||||
/// <param name="p_oVersion">Version of copri- service.</param>
|
||||
public StationDictionary(Version p_oVersion = null, IDictionary<string, IStation> p_oStations = null)
|
||||
{
|
||||
m_oStationDictionary = p_oStations ?? new Dictionary<string, IStation>();
|
||||
|
||||
CopriVersion = p_oVersion != null
|
||||
? new Version(p_oVersion.Major, p_oVersion.Minor, p_oVersion.Revision, p_oVersion.Build)
|
||||
: new Version(0, 0, 0, 0);
|
||||
}
|
||||
CopriVersion = p_oVersion != null
|
||||
? new Version(p_oVersion.Major, p_oVersion.Minor, p_oVersion.Revision, p_oVersion.Build)
|
||||
: new Version(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public IEnumerator<IStation> GetEnumerator()
|
||||
{
|
||||
return m_oStationDictionary.Values.GetEnumerator();
|
||||
}
|
||||
public IEnumerator<IStation> GetEnumerator()
|
||||
{
|
||||
return m_oStationDictionary.Values.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deteermines whether a station by given key exists.
|
||||
/// </summary>
|
||||
/// <param name="key">Key to check.</param>
|
||||
/// <returns>True if station exists.</returns>
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return m_oStationDictionary.ContainsKey(key);
|
||||
}
|
||||
/// <summary>
|
||||
/// Deteermines whether a station by given key exists.
|
||||
/// </summary>
|
||||
/// <param name="key">Key to check.</param>
|
||||
/// <returns>True if station exists.</returns>
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
return m_oStationDictionary.ContainsKey(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a station by station id.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public void RemoveById(string id)
|
||||
{
|
||||
if (!m_oStationDictionary.ContainsKey(id))
|
||||
{
|
||||
// Nothing to do if there is no station with given name.
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
/// Remove a station by station id.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public void RemoveById(string id)
|
||||
{
|
||||
if (!m_oStationDictionary.ContainsKey(id))
|
||||
{
|
||||
// Nothing to do if there is no station with given name.
|
||||
return;
|
||||
}
|
||||
|
||||
m_oStationDictionary.Remove(id);
|
||||
}
|
||||
m_oStationDictionary.Remove(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a station by station name.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public IStation GetById(string id)
|
||||
{
|
||||
if (!m_oStationDictionary.ContainsKey(id))
|
||||
{
|
||||
// Nothing to do if there is no station with given name.
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// Remove a station by station name.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public IStation GetById(string id)
|
||||
{
|
||||
if (!m_oStationDictionary.ContainsKey(id))
|
||||
{
|
||||
// Nothing to do if there is no station with given name.
|
||||
return null;
|
||||
}
|
||||
|
||||
return m_oStationDictionary[id];
|
||||
}
|
||||
return m_oStationDictionary[id];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a station to dictionary of stations.
|
||||
/// </summary>
|
||||
/// <param name="p_oStation"></param>
|
||||
public void Add(Station p_oStation)
|
||||
{
|
||||
if (p_oStation == null)
|
||||
{
|
||||
throw new ArgumentException("Can not add empty station to collection of stations.");
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds a station to dictionary of stations.
|
||||
/// </summary>
|
||||
/// <param name="p_oStation"></param>
|
||||
public void Add(Station p_oStation)
|
||||
{
|
||||
if (p_oStation == null)
|
||||
{
|
||||
throw new ArgumentException("Can not add empty station to collection of stations.");
|
||||
}
|
||||
|
||||
if (m_oStationDictionary.ContainsKey(p_oStation.Id))
|
||||
{
|
||||
throw new ArgumentException(string.Format("Can not add station {0} to collection of stations. A station with given name already exists.", p_oStation.Id));
|
||||
}
|
||||
if (m_oStationDictionary.ContainsKey(p_oStation.Id))
|
||||
{
|
||||
throw new ArgumentException(string.Format("Can not add station {0} to collection of stations. A station with given name already exists.", p_oStation.Id));
|
||||
}
|
||||
|
||||
m_oStationDictionary.Add(p_oStation.Id, p_oStation);
|
||||
}
|
||||
m_oStationDictionary.Add(p_oStation.Id, p_oStation);
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return m_oStationDictionary.Values.GetEnumerator();
|
||||
}
|
||||
}
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return m_oStationDictionary.Values.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue