// Copyright (c) 2017 schick Informatik // Description: Info-Dialog wenn eine Id erhalten wird // using System; using System.Windows; using System.Windows.Input; using System.Windows.Media; using bsmd.database; namespace ENI2.EditControls { /// /// Interaction logic for ShowIdDialog.xaml /// public partial class ShowIdDialog : Window { public ShowIdDialog(MessageCore core) { InitializeComponent(); this.Core = core; } public string DisplayId { set { this.textBoxId.Text = value; } get { return this.textBoxId.Text; } } public bool OpenCore { get; private set; } public MessageCore Core { get; private set; } public void UpdateId(string id) { this.Dispatcher.Invoke(new Action(() => { this.DisplayId = id; this.statusLabel.Content = Properties.Resources.textIdReceived; this.statusLabel.Background = Brushes.LightGreen; this.clickToCopyButton.Visibility = Visibility.Visible; })); } private void Button_Click(object sender, RoutedEventArgs e) { this.Close(); } private void Button_Click_1(object sender, RoutedEventArgs e) { this.OpenCore = true; this.Close(); } private void Window_Loaded(object sender, RoutedEventArgs e) { if(this.Core != null) { this.labelETA.Content = this.Core.ETADisplay; this.labelPoC.Content = this.Core.PoC; this.labelIMO.Content = this.Core.IMO.IsNullOrEmpty() ? this.Core.ENI : this.Core.IMO; } } private void clickToCopyButton_Click(object sender, RoutedEventArgs e) { Clipboard.SetText(this.textBoxId.Text); this.clickToCopyButton.Background = Brushes.LightGreen; } private void textBoxId_MouseDown(object sender, MouseButtonEventArgs e) { Clipboard.SetText(this.textBoxId.Text); } } }