// Copyright (c) 2023 schick Informatik // Description: Show general shipcall info // using BreCalClient.misc.Model; using log4net; using Microsoft.Web.WebView2.Wpf; using System; using System.Diagnostics; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging; namespace BreCalClient { /// /// Interaction logic for ShipcallControl.xaml /// public partial class ShipcallControl : UserControl { #region Fields Participant? _agency; Participant? _pilot; Participant? _mooring; Participant? _terminal; Participant? _tug; Participant? _port_administration; private static readonly ILog _log = LogManager.GetLogger(typeof(ShipcallControl)); private WebView2? _webView = null; #endregion #region Construction public ShipcallControl() { InitializeComponent(); } #endregion #region events public event Action? EditRequested; public event Action? EditAgencyRequested; internal event Action? EditTimesRequested; #endregion #region Properties /// /// this is our datasource /// public ShipcallControlModel? ShipcallControlModel { get; set; } #endregion #region public methods public async void RefreshData() { try { if (this.ShipcallControlModel != null) { bool shiftingNoVisible = ((this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Shifting) && this.ShipcallControlModel.ShiftSequence.HasValue); this.textBlockShiftingSequence.Text = shiftingNoVisible ? this.ShipcallControlModel?.ShiftSequence.ToString() : ""; this.columnDefinitionShiftingSequence.Width = shiftingNoVisible ? new(20) : new(0); string agentName = ""; string? name; _agency = this.ShipcallControlModel?.GetParticipantForType(Extensions.ParticipantType.AGENCY); name = _agency?.Name; if (name != null) agentName = name; this.labelAgent.Content = name ?? "- / -"; if(_agency == null) { // clear agency display controls this.labelAgencyBerth.Content = ""; this.labelAgencyETAETDValue.Content = ""; this.textBlockAgencyRemarks.Text = ""; this.textBlockAgencyBerthRemarks.Text = ""; } _mooring = this.ShipcallControlModel?.GetParticipantForType(Extensions.ParticipantType.MOORING); name = _mooring?.Name; this.labelMooring.Content = name ?? "- / -"; if(_mooring == null) { this.labelMooringETAETDValue.Content = ""; this.textBlockMooringRemarks.Text = ""; } _pilot = this.ShipcallControlModel?.GetParticipantForType(Extensions.ParticipantType.PILOT); name = _pilot?.Name; this.labelPilot.Content = name ?? "- / - "; if(_pilot == null) { this.labelPilotETAETDValue.Content = ""; this.textBlockPilotRemarks.Text = ""; } _tug = this.ShipcallControlModel?.GetParticipantForType(Extensions.ParticipantType.TUG); name = _tug?.Name; this.labelTug.Content = name ?? "- / - "; if(_tug == null) { this.labelTugETAETDValue.Content = ""; this.textBlockTugRemarks.Text = ""; } _port_administration = this.ShipcallControlModel?.GetParticipantForType(Extensions.ParticipantType.PORT_ADMINISTRATION); name = _port_administration?.Name; this.labelPortAuthority.Content = name ?? "- / - "; if(_port_administration == null) { this.labelPortAuthorityETAETDValue.Content = ""; this.textBlockPortAuthorityRemarks.Text = ""; } _terminal = this.ShipcallControlModel?.GetParticipantForType(Extensions.ParticipantType.TERMINAL); name = _terminal?.Name; this.labelTerminal.Content = name ?? "- / - "; if(_terminal == null) { this.textBlockTerminalRemarks.Text = ""; this.textBlockTerminalBerthRemarks.Text = ""; this.labelTerminalBerth.Content = ""; this.labelOperationsStart.Content = ""; } if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TERMINAL) && (App.Participant.Id == _terminal?.Id)) { this.labelTerminal.FontWeight = FontWeights.Bold; this.labelTerminal.Foreground = Brushes.LightYellow; } else { this.labelTerminal.FontWeight = FontWeights.Normal; this.labelTerminal.Foreground = Brushes.White; } if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.PILOT) && (App.Participant.Id == _pilot?.Id)) { this.labelPilot.FontWeight = FontWeights.Bold; this.labelPilot.Foreground = Brushes.LightYellow; } else { this.labelPilot.FontWeight = FontWeights.Normal; this.labelPilot.Foreground = Brushes.White; } if ((App.Participant.IsTypeFlagSet(Extensions.ParticipantType.AGENCY) && (App.Participant.Id == _agency?.Id)) || (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.BSMD) && (_agency != null) && _agency.IsFlagSet(Extensions.ParticipantFlag.ALLOW_BSMD))) { this.labelAgent.FontWeight = FontWeights.Bold; this.labelAgent.Foreground = Brushes.LightYellow; } else { this.labelAgent.FontWeight = FontWeights.Normal; this.labelAgent.Foreground = Brushes.White; } if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.MOORING) && (App.Participant.Id == _mooring?.Id)) { this.labelMooring.FontWeight = FontWeights.Bold; this.labelMooring.Foreground = Brushes.LightYellow; } else { this.labelMooring.FontWeight = FontWeights.Normal; this.labelMooring.Foreground = Brushes.White; } if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION) && (App.Participant.Id == _port_administration?.Id)) { this.labelPortAuthority.FontWeight = FontWeights.Bold; this.labelPortAuthority.Foreground = Brushes.LightYellow; } else { this.labelPortAuthority.FontWeight = FontWeights.Normal; this.labelPortAuthority.Foreground = Brushes.White; } if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TUG) && (App.Participant.Id == _tug?.Id)) { this.labelTug.FontWeight = FontWeights.Bold; this.labelTug.Foreground = Brushes.LightYellow; } else { this.labelTug.FontWeight = FontWeights.Normal; this.labelTug.Foreground = Brushes.White; } if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.BSMD)) { this.labelShipName.FontWeight = FontWeights.Bold; this.labelShipName.Foreground = Brushes.LightYellow; } else { this.labelShipName.FontWeight = FontWeights.Normal; this.labelShipName.Foreground = Brushes.White; } this.textBlockShipName.Text = this.ShipcallControlModel?.Ship?.Name; // this.labelShipName.Content = this.ShipcallControlModel?.Ship?.Name; switch (this.ShipcallControlModel?.Shipcall?.Type) { case ShipcallType.Arrival: // incoming this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalClient;component/Resources/arrow_down_red.png")); break; case ShipcallType.Departure: // outgoing this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalClient;component/Resources/arrow_up_blue.png")); break; case ShipcallType.Shifting: // shifting this.imageShipcallType.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalClient;component/Resources/arrow_right_green.png")); break; default: break; } switch(this.ShipcallControlModel?.LightMode) { case EvaluationType.Green: this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalClient;component/Resources/check.png")); break; case EvaluationType.Yellow: this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalClient;component/Resources/sign_warning.png")); break; case EvaluationType.Red: this.imageEvaluation.Source = new BitmapImage(new Uri("pack://application:,,,/BreCalClient;component/Resources/delete2.png")); break; default: break; } if (this.ShipcallControlModel?.Shipcall?.Canceled ?? false) { this.Background = Brushes.LightGray; //this.Foreground = Brushes.DarkGray; this.labelShipName.Foreground = Brushes.LightGray; this.textBlockShipName.TextDecorations.Add(TextDecorations.Strikethrough); } else { if (this.ShipcallControlModel?.Shipcall?.Evaluation != null) { this.Background = this.ShipcallControlModel.LightMode switch { // ShipcallControlModel.TrafficLightMode.GREEN => this.Background = Brushes.LightGreen, EvaluationType.Yellow => Brushes.LightYellow, EvaluationType.Red => new SolidColorBrush(Color.FromArgb(200, 255, 100, 100)), _ => Brushes.Transparent, }; } } if (!string.IsNullOrEmpty(this.ShipcallControlModel?.Shipcall?.EvaluationMessage)) this.imageEvaluation.ToolTip = this.ShipcallControlModel?.Shipcall?.EvaluationMessage; else this.imageEvaluation.ToolTip = null; this.textBlockBerth.Text = this.ShipcallControlModel?.GetBerthText(null); this.textBlockDraft.Text = (this.ShipcallControlModel?.Shipcall?.Draft != null) ? $"{this.ShipcallControlModel?.Shipcall?.Draft.Value.ToString("N1")} m" : "-"; this.textBlockETA.Text = this.ShipcallControlModel?.GetETAETD(true); this.textBlockIMO.Text = this.ShipcallControlModel?.Ship?.Imo.ToString(); this.textBlockLengthWidth.Text = $"{this.ShipcallControlModel?.Ship?.Length} / {this.ShipcallControlModel?.Ship?.Width}"; // rename labels if this is not an incoming // must be here because there may not be a times record for each participant (yet) if (this.ShipcallControlModel?.Shipcall?.Type != ShipcallType.Arrival) { this.labelETA.Text = "ETD"; this.labelETAETDAgent.Content = "ETD"; this.labelETAETDMooring.Content = "ETD"; this.labelETAETDPilot.Content = "ETD"; this.labelETAETDPortAuthority.Content = "ETD"; this.labelETAETDTug.Content = "ETD"; this.labelETAETDTerminal.Content = BreCalClient.Resources.Resources.textOperationsEnd; } if((this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) && (this.ShipcallControlModel?.Shipcall.TimeRefPoint != null)) { int timeRefPointIndex = this.ShipcallControlModel?.Shipcall?.TimeRefPoint ?? 0; this.labelETAETDAgent.Content = BreCalLists.TimeRefs[timeRefPointIndex]; this.labelETAETDMooring.Content = BreCalLists.TimeRefs[timeRefPointIndex]; this.labelETAETDPilot.Content = BreCalLists.TimeRefs[timeRefPointIndex]; this.labelETAETDPortAuthority.Content = BreCalLists.TimeRefs[timeRefPointIndex]; this.labelETAETDTug.Content = BreCalLists.TimeRefs[timeRefPointIndex]; } if (this.ShipcallControlModel != null) { this.textBlockHarbour.Text = ((ShipcallControlModel != null) && (ShipcallControlModel.Shipcall != null) && BreCalLists.PortLookupDict.ContainsKey(ShipcallControlModel.Shipcall.PortId)) ? BreCalLists.PortLookupDict[ShipcallControlModel.Shipcall.PortId].Name : ""; Extensions.ParticipantType? lastToUpdate = this.ShipcallControlModel?.LastParticipantTypeToUpdate(); Times? agencyTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); if (agencyTimes != null) { this.labelAgencyBerth.Content = this.ShipcallControlModel?.GetBerthText(agencyTimes); this.labelAgencyETAETDValue.Content = agencyTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival); this.textBlockAgencyRemarks.Text = agencyTimes.Remarks.TruncateDots(50); this.textBlockAgencyBerthRemarks.Text = agencyTimes.BerthInfo.TruncateDots(50); DateTime? lc = this.ShipcallControlModel?.GetLastChangeForType(Extensions.ParticipantType.AGENCY); this.labelLastChangeAgency.Content = lc.HasValue ? lc.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty; Grid.SetRowSpan(this.labelAgent, 1); if(lastToUpdate == Extensions.ParticipantType.AGENCY) { this.labelLastChangeAgency.Foreground = Brushes.White; this.labelLastChangeAgency.FontWeight = FontWeights.DemiBold; } else { this.labelLastChangeAgency.Foreground = Brushes.LightGray; this.labelLastChangeAgency.FontWeight = FontWeights.Normal; } } else { // no agency times set (yet) this.labelAgencyBerth.Content = ""; this.labelAgencyETAETDValue.Content = "- / -"; this.textBlockAgencyRemarks.Text = ""; this.textBlockAgencyBerthRemarks.Text = ""; Grid.SetRowSpan(this.labelAgent, 2); } Times? mooringTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.MOORING); if (mooringTimes != null) { this.labelMooringETAETDValue.Content = mooringTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival); this.textBlockMooringRemarks.Text = mooringTimes.Remarks.TruncateDots(50); this.imageMooringLocked.Visibility = (mooringTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden; ataRowDefinition.Height = mooringTimes.Ata.HasValue ? new(15) : new(0); atdRowDefinition.Height = mooringTimes.Atd.HasValue ? new(15) : new(0); if(mooringTimes.Ata.HasValue) { labelTimesMooringATA.Content = mooringTimes.Ata.Value.ToString("dd.MM.yyyy HH:mm"); } if (mooringTimes.Atd.HasValue) { labelTimesMooringATD.Content = mooringTimes.Atd.Value.ToString("dd.MM.yyyy HH:mm"); } DateTime? lc = this.ShipcallControlModel?.GetLastChangeForType(Extensions.ParticipantType.MOORING); this.labelLastChangeMooring.Content = lc.HasValue ? lc.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty; Grid.SetRowSpan(this.labelMooring, 1); if (lastToUpdate == Extensions.ParticipantType.MOORING) { this.labelLastChangeMooring.Foreground = Brushes.White; this.labelLastChangeMooring.FontWeight = FontWeights.DemiBold; } else { this.labelLastChangeMooring.Foreground = Brushes.LightGray; this.labelLastChangeMooring.FontWeight = FontWeights.Normal; } } else { this.labelMooringETAETDValue.Content = "- / "; this.textBlockMooringRemarks.Text = ""; this.imageMooringLocked.Visibility = Visibility.Hidden; Grid.SetRowSpan(this.labelMooring, 2); } Times? portAuthorityTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION); if (portAuthorityTimes != null) { this.labelPortAuthorityETAETDValue.Content = portAuthorityTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival); this.textBlockPortAuthorityRemarks.Text = portAuthorityTimes.Remarks.TruncateDots(50); this.imagePortAuthorityLocked.Visibility = (portAuthorityTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden; lockTimeRowDefinition.Height = portAuthorityTimes.LockTime.HasValue ? new(15) : new(0); if(portAuthorityTimes.LockTime.HasValue) { labelPortAuthorityLockTime.Content = portAuthorityTimes.LockTime.Value.ToString("dd.MM.yyyy HH:mm"); } DateTime? lc = this.ShipcallControlModel?.GetLastChangeForType(Extensions.ParticipantType.PORT_ADMINISTRATION); this.labelLastChangePortAuthority.Content = lc.HasValue ? lc.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty; Grid.SetRowSpan(this.labelPortAuthority, 1); if (lastToUpdate == Extensions.ParticipantType.PORT_ADMINISTRATION) { this.labelLastChangePortAuthority.Foreground = Brushes.White; this.labelLastChangePortAuthority.FontWeight = FontWeights.DemiBold; } else { this.labelLastChangePortAuthority.Foreground = Brushes.LightGray; this.labelLastChangePortAuthority.FontWeight = FontWeights.Normal; } } else { this.labelPortAuthorityETAETDValue.Content = "- / -"; this.textBlockPortAuthorityRemarks.Text = ""; this.imagePortAuthorityLocked.Visibility = Visibility.Hidden; Grid.SetRowSpan(this.labelPortAuthority, 2); } Times? pilotTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PILOT); if (pilotTimes != null) { this.labelPilotETAETDValue.Content = pilotTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival); this.textBlockPilotRemarks.Text = pilotTimes.Remarks.TruncateDots(50); this.imagePilotLocked.Visibility = (pilotTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden; DateTime? lc = this.ShipcallControlModel?.GetLastChangeForType(Extensions.ParticipantType.PILOT); this.labelLastChangePilot.Content = lc.HasValue ? lc.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty; Grid.SetRowSpan(this.labelPilot, 1); if (lastToUpdate == Extensions.ParticipantType.PILOT) { this.labelLastChangePilot.Foreground = Brushes.White; this.labelLastChangePilot.FontWeight = FontWeights.DemiBold; } else { this.labelLastChangePilot.Foreground = Brushes.LightGray; this.labelLastChangePilot.FontWeight = FontWeights.Normal; } } else { this.labelPilotETAETDValue.Content = "- / -"; this.textBlockPilotRemarks.Text = ""; this.imagePilotLocked.Visibility = Visibility.Hidden; Grid.SetRowSpan(this.labelPilot, 2); } Times? tugTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TUG); if (tugTimes != null) { this.labelTugETAETDValue.Content = tugTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival); this.textBlockTugRemarks.Text = tugTimes.Remarks.TruncateDots(50); this.imageTugLocked.Visibility = (tugTimes.EtaBerthFixed ?? false) ? Visibility.Visible : Visibility.Hidden; DateTime? lc = this.ShipcallControlModel?.GetLastChangeForType(Extensions.ParticipantType.TUG); this.labelLastChangeTug.Content = lc.HasValue ? lc.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty; Grid.SetRowSpan(this.labelTug, 1); if (lastToUpdate == Extensions.ParticipantType.TUG) { this.labelLastChangeTug.Foreground = Brushes.White; this.labelLastChangeTug.FontWeight = FontWeights.DemiBold; } else { this.labelLastChangeTug.Foreground = Brushes.LightGray; this.labelLastChangeTug.FontWeight = FontWeights.Normal; } } else { this.labelTugETAETDValue.Content = "- / -"; this.textBlockTugRemarks.Text = ""; this.imageTugLocked.Visibility = Visibility.Hidden; Grid.SetRowSpan(this.labelTug, 2); } this.rowDefinitionTerminalBerth.Height = (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) ? new(14) : new(0); this.rowDefinitionTerminalBerthRemarks.Height = (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) ? new GridLength(.5, GridUnitType.Star) : new(0); Times ? terminalTimes = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL); if (terminalTimes != null) { this.labelTerminalBerth.Visibility = (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) ? Visibility.Visible : Visibility.Hidden; this.labelTerminalBerth.Content = this.ShipcallControlModel?.GetBerthText(terminalTimes); this.labelOperationsStart.Content = terminalTimes.DisplayTime(this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival); this.textBlockTerminalRemarks.Text = terminalTimes.Remarks.TruncateDots(40); this.textBlockTerminalBerthRemarks.Text = terminalTimes.BerthInfo.TruncateDots(40); DateTime? lc = this.ShipcallControlModel?.GetLastChangeForType(Extensions.ParticipantType.TERMINAL); this.labelLastChangeTerminal.Content = lc.HasValue ? lc.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty; Grid.SetRowSpan(this.labelTerminal, 1); if (lastToUpdate == Extensions.ParticipantType.TERMINAL) { this.labelLastChangeTerminal.Foreground = Brushes.White; this.labelLastChangeTerminal.FontWeight = FontWeights.DemiBold; } else { this.labelLastChangeTerminal.Foreground = Brushes.LightGray; this.labelLastChangeTerminal.FontWeight = FontWeights.Normal; } } else { this.labelTerminalBerth.Content = ""; this.labelOperationsStart.Content = ""; this.textBlockTerminalRemarks.Text = ""; this.textBlockTerminalBerthRemarks.Text = ""; Grid.SetRowSpan(this.labelTerminal, 2); } } this.DataContext = this.ShipcallControlModel; // initialize Map if eta is close to current time DateTime? refTime = (this.ShipcallControlModel?.Shipcall?.Type == ShipcallType.Arrival) ? this.ShipcallControlModel?.Eta : this.ShipcallControlModel?.Etd; if (refTime.HasValue) { if ((refTime.Value > DateTime.Now.AddDays(-1)) && refTime.Value < DateTime.Now.AddDays(2)) { if(this._webView == null) { _webView = new WebView2(); Button popOutButton = new() { Width = 16, Height = 16, Content = new Image { Source = new BitmapImage(new Uri("Resources/window_size.png", UriKind.Relative)) }, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top }; popOutButton.Click += (o, e) => { System.Diagnostics.Trace.WriteLine("Popout button clicked"); var pop = new Window { Title = "Detail map", Width = 800, Height = 600 }; this.placeHolderMap.Children.Remove(_webView); pop.Content = _webView; pop.Closing += (s, a) => { pop.Content = null; this.placeHolderMap.Children.Add(_webView); popOutButton.IsEnabled = true; }; pop.Show(); popOutButton.IsEnabled = false; }; string trenzUri = $"https://aismap.trenz.de/Live/StaticDemo.aspx?site=bsmd&Zoom=13&api=usgPcOPJnvTWUPTVbfVs&apikey=demo-H6cE4SG0FG&imo={this.ShipcallControlModel?.Ship?.Imo}"; await Dispatcher.InvokeAsync(() => { buttonPanel.Children.Add(popOutButton); placeHolderMap.Children.Add(_webView); try { _webView.EnsureCoreWebView2Async(null); _webView.Source = new Uri(trenzUri); } catch(Exception ex) { MessageBox.Show($"WebView2 initialization failed: {ex.Message}"); } }); } } } } } catch (Exception ex) { _log.ErrorFormat("Something went wrong during data refresh: {0}", ex.ToString()); } } #endregion #region event handler private void buttonEditShipcall_Click(object? sender, RoutedEventArgs? e) { if(App.Participant.IsTypeFlagSet(Extensions.ParticipantType.BSMD)) this.EditRequested?.Invoke(this); } private void Image_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { this.buttonEditShipcall_Click(null, null); } private void labelAgent_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY); this.EditAgencyRequested?.Invoke(this, times); } private void labelMooring_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.MOORING); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.MOORING); } private void labelPortAuthority_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.PORT_ADMINISTRATION); } private void labelPilot_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PILOT); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.PILOT); } private void labelTug_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TUG); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.TUG); } private void labelTerminal_PreviewMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) { Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.TERMINAL); } #endregion } }