55 lines
1.8 KiB
C#
55 lines
1.8 KiB
C#
using System;
|
|
using System.Windows;
|
|
|
|
|
|
namespace BeWo.View
|
|
{
|
|
public partial class ExceptionMessageBox
|
|
{
|
|
public ExceptionMessageBox(string message, Exception ex, bool showDetails)
|
|
{
|
|
InitializeComponent();
|
|
|
|
if (!String.IsNullOrEmpty(message) && !showDetails)
|
|
tb_message.Text = message;
|
|
else
|
|
{
|
|
tb_message.Text =
|
|
"Es ist leider ein unbekannter Fehler aufgetreten. Prüfen Sie Ihre Internetverbindung oder versuchen Sie es später erneut. Wir sind stets bemüht das Programm zu verbessern, daher freuen wir uns auch, wenn Sie die Fehlerdetails unten in einer Mail an support@bewoplaner.de senden.";
|
|
|
|
|
|
}
|
|
|
|
if (!showDetails)
|
|
{
|
|
lblError.Visibility = Visibility.Collapsed;
|
|
contentError.Visibility = Visibility.Collapsed;
|
|
} else
|
|
{
|
|
tb_stack.Text = String.Empty;
|
|
if (!String.IsNullOrEmpty(message))
|
|
{
|
|
tb_stack.Text = message + System.Environment.NewLine + System.Environment.NewLine + tb_stack.Text;
|
|
}
|
|
if (ex != null)
|
|
{
|
|
tb_stack.Text += ex.ToString();
|
|
}
|
|
lblError.Visibility = Visibility.Visible;
|
|
contentError.Visibility = Visibility.Visible;
|
|
}
|
|
}
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (BeWoApp.MainControl != null)
|
|
{
|
|
BeWoApp.MainControl.CloseCurrentPopUp();
|
|
}
|
|
else if (BeWoApp.LoginControl != null)
|
|
{
|
|
BeWoApp.LoginControl.CloseCurrentPopUp();
|
|
}
|
|
}
|
|
}
|
|
} |