-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugWindow.xaml.cs
More file actions
43 lines (36 loc) · 976 Bytes
/
DebugWindow.xaml.cs
File metadata and controls
43 lines (36 loc) · 976 Bytes
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
39
40
41
42
43
using System;
using System.Windows;
using System.Windows.Controls;
namespace TaskPilot
{
public partial class DebugWindow : Window
{
public static DebugWindow? Instance { get; private set; }
public DebugWindow()
{
InitializeComponent();
Instance = this;
LogMessage("Debug-Konsole gestartet...");
this.Closing += (s, e) =>
{
Instance = null;
};
}
public void LogMessage(string message)
{
Dispatcher.Invoke(() =>
{
LogTextBox.AppendText($"[{DateTime.Now:HH:mm:ss.fff}] {message}\n");
LogTextBox.ScrollToEnd();
});
}
private void Clear_Click(object sender, RoutedEventArgs e)
{
LogTextBox.Clear();
}
private void Close_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}