Contact page shows operator specific info

This commit is contained in:
Oliver Hauff 2021-07-20 23:06:09 +02:00
parent e436e83c1d
commit a58c33f005
51 changed files with 948 additions and 221 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using TINK.Model.Station.Operator;
namespace TINK.Model.Station
{
@ -15,5 +16,8 @@ namespace TINK.Model.Station
/// <summary> Holds the gps- position of the station.</summary>
Position Position { get; }
/// <summary> Holds operator related data.</summary>
IData OperatorData { get; }
}
}

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using TINK.Model.Station.Operator;
namespace TINK.Model.Station
{
@ -16,5 +17,8 @@ namespace TINK.Model.Station
/// <summary> Holds the gps- position of the station.</summary>
public Position Position => new Position(double.NaN, double.NaN);
/// <summary> Holds operator related data.</summary>
public IData OperatorData => new Data();
}
}

View file

@ -0,0 +1,36 @@
using Xamarin.Forms;
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> 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> 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> Color of the operator (operator specific skin)</summary>
public Color? Color { get; private set; }
}
}

View file

@ -0,0 +1,22 @@
using Xamarin.Forms;
namespace TINK.Model.Station.Operator
{
public interface IData
{
/// <summary> Name of the operator.</summary>
string Name { get; }
/// <summary> Support phone number of the operator.</summary>
string PhoneNumberText { get; }
/// <summary> Office times when support is available.</summary>
string Hours { get; }
/// <summary> Support mails address of the operator.</summary>
string MailAddressText { get; }
/// <summary> Color of the operator (operator specific skin)</summary>
Color? Color { get; }
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using TINK.Model.Station.Operator;
namespace TINK.Model.Station
{
@ -7,20 +8,22 @@ namespace TINK.Model.Station
public class Station : IStation
{
/// <summary> Constructs a station object.</summary>
/// <param name="p_iId">Id of the station.</param>
/// <param name="p_oGroup">Group (TINK, Konrad) to which station is related.</param>
/// <param name="p_oPosition">GPS- position of the station.</param>
/// <param name="p_strStationName">Name of the station.</param>
/// <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 p_iId,
IEnumerable<string> p_oGroup,
Position p_oPosition,
string p_strStationName = "")
string id,
IEnumerable<string> group,
Position position,
string stationName = "",
Data operatorData = null)
{
Id = p_iId;
Group = p_oGroup ?? throw new ArgumentException("Can not construct station object. Group of stations must not be null.");
Position = p_oPosition;
StationName = p_strStationName ?? string.Empty;
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>
@ -34,5 +37,8 @@ namespace TINK.Model.Station
/// <summary> Holds the gps- position of the station.</summary>
public Position Position { get; }
/// <summary> Holds operator related info.</summary>
public IData OperatorData { get; }
}
}