-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplayMessageDetails.xaml.cs
38 lines (36 loc) · 1.09 KB
/
DisplayMessageDetails.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Windows;
namespace RS.WPF.MessageDisplay;
/// <summary>
/// Interaction logic for DisplayMessageDetails.xaml
/// </summary>
public partial class DisplayMessageDetails : Window
{
public DisplayMessageDetails(string Message,Exception ex=null)
{
InitializeComponent();
this.TxtMessage.Text = Message;
if (ex!=null)
{
this.GrpInnerException.Visibility = Visibility.Visible;
this.TxtInnerException.Text = ex.ToString();
}
else
{
this.GrpInnerException.Visibility = Visibility.Collapsed;
}
}
private void BtnCopyMessage_Click(object sender, RoutedEventArgs e)
{
Clipboard.Clear();
string InnerException = string.IsNullOrWhiteSpace(TxtInnerException.Text) ? "" : $"Inner Exception:\n {TxtInnerException.Text}";
Clipboard.SetText($"Message:-\n" +
$"{TxtMessage.Text}" +
$"\n" +
$"\n{InnerException}");
}
private void BtnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}