diff --git a/src/BreCalClient/Extensions.cs b/src/BreCalClient/Extensions.cs
index 9ec655a..de76cdb 100644
--- a/src/BreCalClient/Extensions.cs
+++ b/src/BreCalClient/Extensions.cs
@@ -72,6 +72,14 @@ namespace BreCalClient
return value.Length <= maxLength ? value : value.Substring(0, maxLength);
}
+ public static string TruncateDots(this string value, int maxLength)
+ {
+ if(string.IsNullOrEmpty(value)) return value;
+ if (value.Length <= maxLength) return value;
+ if (value.Length > (maxLength + 1)) return $"{value.Substring(0, maxLength)}..";
+ return value.Substring(0, maxLength);
+ }
+
#endregion
}
diff --git a/src/BreCalClient/ShipcallControl.xaml b/src/BreCalClient/ShipcallControl.xaml
index 2389d19..075b91a 100644
--- a/src/BreCalClient/ShipcallControl.xaml
+++ b/src/BreCalClient/ShipcallControl.xaml
@@ -49,40 +49,40 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/BreCalClient/ShipcallControl.xaml.cs b/src/BreCalClient/ShipcallControl.xaml.cs
index 3110d56..208090d 100644
--- a/src/BreCalClient/ShipcallControl.xaml.cs
+++ b/src/BreCalClient/ShipcallControl.xaml.cs
@@ -54,12 +54,16 @@ namespace BreCalClient
#region public methods
public void RefreshData()
- {
+ {
if (this.ShipcallControlModel == null) return;
+ string agentName = "";
string? name;
name = this.ShipcallControlModel.GetParticipantNameForType(Extensions.ParticipantType.AGENCY);
if (name != null)
+ {
this.labelAgent.Content = name;
+ agentName = name;
+ }
name = this.ShipcallControlModel.GetParticipantNameForType(Extensions.ParticipantType.MOORING);
if (name != null)
this.labelMooring.Content = name;
@@ -126,16 +130,17 @@ namespace BreCalClient
this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign;
if ((this.ShipcallControlModel?.Shipcall?.Type == 1) || (this.ShipcallControlModel?.Shipcall?.Type == 3))
{
- this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta.ToString();
+ this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta.ToString("dd.MM. HH:mm");
}
if(this.ShipcallControlModel?.Shipcall?.Type == 2)
{
this.labelETA.Text = "ETD";
- this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd.ToString();
+ this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Etd?.ToString("dd.MM. HH:mm");
}
this.textBlockIMO.Text = this.ShipcallControlModel?.Ship?.Imo.ToString();
this.textBlockLengthWidth.Text = $"{this.ShipcallControlModel?.Ship?.Length} / {this.ShipcallControlModel?.Ship?.Width}";
+ this.textBlockAgency.Text = agentName.TruncateDots(10);
if (this.ParticipantDict != null)
{