Files
BeWoPlaner/BeWo/UploadDialog.xaml.cs

91 lines
2.6 KiB
C#
Raw Permalink Normal View History

2016-06-27 01:45:38 +02:00
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
{
/// <summary>
/// Interaktionslogik für OpenOrSaveDialog.xaml
/// </summary>
public partial class UploadDialog : Window
{
public bool Upload;
private string _Question;
public string Question
{
get { return _Question; }
2017-03-28 11:01:28 +02:00
set { _Question = string.Format("Die Datei \"{0}\" wurde geändert. Möchten Sie die geänderte Datei hochladen?", value); }
2016-06-27 01:45:38 +02:00
}
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) {
2017-02-18 16:16:19 +01:00
_Question = string.Format("Bitte schließen sie zuerst das bearbeitete Dokument.");
Hochladebtn.Content = "Erneut versuchen";
2016-06-27 01:45:38 +02:00
erneutversuchen = true;
pfad = fileName;
}
if (schalter == 3)
{
Hochladebtn.Visibility = Visibility.Visible;
_Question = string.Format(fileName);
Hochladebtn.Content = "Überschreiben";
2016-06-27 01:45:38 +02:00
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();
}
}
}