We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fb22e1 commit 8d9ecbeCopy full SHA for 8d9ecbe
1 file changed
Buttplug.Components.Controls/ButtplugLogControl.xaml.cs
@@ -13,6 +13,7 @@
13
using NLog;
14
using NLog.Config;
15
using NLog.Targets;
16
+using System.Collections.Specialized;
17
18
namespace Buttplug.Components.Controls
19
{
@@ -39,14 +40,25 @@ protected override void Write(LogEventInfo aLogEvent)
39
40
41
try
42
- Dispatcher.FromThread(_winThread).Invoke(() =>
43
+ if (_winThread != Dispatcher.CurrentDispatcher.Thread)
44
+ {
45
+ Dispatcher.FromThread(_winThread).Invoke(() =>
46
47
+ _logs.Add(Layout.Render(aLogEvent));
48
+ while (_logs.Count > MaxLogs)
49
50
+ _logs.RemoveAt(0);
51
+ }
52
+ });
53
54
+ else
55
56
_logs.Add(Layout.Render(aLogEvent));
57
while (_logs.Count > MaxLogs)
58
59
_logs.RemoveAt(0);
60
}
- });
61
62
63
catch (TaskCanceledException)
64
0 commit comments