using BeWo.Core; using BeWo.ServiceProxy; using BeWo.View; using BeWo.ViewModel; using BS.Shared; using BS.Shared.Core; using BS.Shared.Extensions; using System; using System.IO; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Threading; namespace BeWo { /// /// Interaktionslogik für OpenOrSaveDialog.xaml /// public partial class UploadDialog : Window { public bool Upload; private string _Question; public string Question { get { return _Question; } set { _Question = string.Format("Die Datei \"{0}\" wurde geändert. Möchten Sie die geänderte Datei hochladen?", value); } } public int schalter; public bool erneutversuchen; public string pfad =""; public UploadDialog(string fileName, int iterator) { InitializeComponent(); InitCommandBindings(); Owner = GetWindow(BeWoApp.MainControl.ActiveView); schalter = iterator; if (schalter == 1) { Hochladebtn.Visibility = Visibility.Visible; Question = fileName; Hochladebtn.Content = "Hochladen"; } if (schalter == 2) { _Question = string.Format("Bitte schließen sie zuerst das bearbeitete Dokument."); Hochladebtn.Content = "Erneut versuchen"; erneutversuchen = true; pfad = fileName; } if (schalter == 3) { Hochladebtn.Visibility = Visibility.Visible; _Question = string.Format(fileName); Hochladebtn.Content = "Überschreiben"; Abbrechbtn.Content = "Behalten"; } DataContext = this; } private void InitCommandBindings() { CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => { Upload = false; Close(); })); } private void UIElement_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { try { DragMove(); } catch (Exception){} } private void btn_Upload_Click(object sender, RoutedEventArgs e) { Upload = true; erneutversuchen = true; Close(); } } }