Code updated to 3.0.238

This commit is contained in:
Oliver Hauff 2021-06-26 20:57:55 +02:00
parent 3302d80678
commit 9c6a1fa92b
257 changed files with 7763 additions and 2861 deletions

View file

@ -5,7 +5,7 @@ namespace TINK.Model.Station
public interface IStation
{
/// <summary> Holds the unique id of the station.c</summary>
int Id { get; }
string Id { get; }
/// <summary> Holds the group to which the station belongs.</summary>
IEnumerable<string> Group { get; }

View file

@ -6,7 +6,7 @@ namespace TINK.Model.Station
public class NullStation : IStation
{
/// <summary> Holds the unique id of the station.c</summary>
public int Id => -1;
public string Id => null;
/// <summary> Holds the group to which the station belongs.</summary>
public IEnumerable<string> Group => new List<string>();

View file

@ -12,7 +12,7 @@ namespace TINK.Model.Station
/// <param name="p_oPosition">GPS- position of the station.</param>
/// <param name="p_strStationName">Name of the station.</param>
public Station(
int p_iId,
string p_iId,
IEnumerable<string> p_oGroup,
Position p_oPosition,
string p_strStationName = "")
@ -24,7 +24,7 @@ namespace TINK.Model.Station
}
/// <summary> Holds the unique id of the station.c</summary>
public int Id { get; }
public string Id { get; }
/// <summary> Holds the group to which the station belongs.</summary>
public IEnumerable<string> Group { get; }

View file

@ -4,10 +4,10 @@ using System.Collections.Generic;
namespace TINK.Model.Station
{
public class StationDictionary : IEnumerable<Station>
public class StationDictionary : IEnumerable<IStation>
{
/// <summary> Holds the list of stations. </summary>
private readonly IDictionary<int, Station> m_oStationDictionary;
private readonly IDictionary<string, IStation> m_oStationDictionary;
/// <summary> Count of stations. </summary>
public int Count { get { return m_oStationDictionary.Count; } }
@ -16,16 +16,16 @@ namespace TINK.Model.Station
/// <summary> Constructs a station dictionary object. </summary>
/// <param name="p_oVersion">Version of copri- service.</param>
public StationDictionary(Version p_oVersion = null, IDictionary<int, Station> p_oStations = null)
public StationDictionary(Version p_oVersion = null, IDictionary<string, IStation> p_oStations = null)
{
m_oStationDictionary = p_oStations ?? new Dictionary<int, Station>();
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);
}
public IEnumerator<Station> GetEnumerator()
public IEnumerator<IStation> GetEnumerator()
{
return m_oStationDictionary.Values.GetEnumerator();
}
@ -33,41 +33,41 @@ namespace TINK.Model.Station
/// <summary>
/// Deteermines whether a station by given key exists.
/// </summary>
/// <param name="p_strKey">Key to check.</param>
/// <param name="key">Key to check.</param>
/// <returns>True if station exists.</returns>
public bool ContainsKey(int p_strKey)
public bool ContainsKey(string key)
{
return m_oStationDictionary.ContainsKey(p_strKey);
return m_oStationDictionary.ContainsKey(key);
}
/// <summary>
/// Remove a station by station id.
/// </summary>
/// <param name="p_iId"></param>
public void RemoveById(int p_iId)
/// <param name="id"></param>
public void RemoveById(string id)
{
if (!m_oStationDictionary.ContainsKey(p_iId))
if (!m_oStationDictionary.ContainsKey(id))
{
// Nothing to do if there is no station with given name.
return;
}
m_oStationDictionary.Remove(p_iId);
m_oStationDictionary.Remove(id);
}
/// <summary>
/// Remove a station by station name.
/// </summary>
/// <param name="p_iId"></param>
public Station GetById(int p_iId)
/// <param name="id"></param>
public IStation GetById(string id)
{
if (!m_oStationDictionary.ContainsKey(p_iId))
if (!m_oStationDictionary.ContainsKey(id))
{
// Nothing to do if there is no station with given name.
return null;
}
return m_oStationDictionary[p_iId];
return m_oStationDictionary[id];
}
/// <summary>