This commit is contained in:
@@ -561,9 +561,7 @@ namespace Elwig.Helpers {
|
||||
Log = "Application",
|
||||
Source = ".NET Runtime",
|
||||
};
|
||||
return log.Entries.Cast<EventLogEntry>()
|
||||
.Where(e => e.Message.StartsWith("Application: Elwig.exe"))
|
||||
.ToList();
|
||||
return [.. log.Entries.OfType<EventLogEntry>().Where(e => e.InstanceId == 1026).Where(e => e.Message.StartsWith("Application: Elwig.exe"))];
|
||||
}
|
||||
|
||||
public static int GetEntityIdetifierForPk(params object?[] primaryKey) {
|
||||
|
@@ -1,7 +1,9 @@
|
||||
using Elwig.Helpers;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Elwig.Windows {
|
||||
public partial class LogWindow : Window {
|
||||
@@ -11,9 +13,11 @@ namespace Elwig.Windows {
|
||||
WindowState = WindowState.Maximized;
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
||||
private async void Window_Loaded(object sender, RoutedEventArgs evt) {
|
||||
Mouse.OverrideCursor = Cursors.Wait;
|
||||
await Task.Run(async () => {
|
||||
var log = Utils.GetLogEntries();
|
||||
EventList.ItemsSource = log
|
||||
var list = log
|
||||
.Select(e => new {
|
||||
Event = e,
|
||||
Lines = e.Message.Split('\n').ToArray(),
|
||||
@@ -32,7 +36,12 @@ namespace Elwig.Windows {
|
||||
})
|
||||
.OrderByDescending(e => e.Event.TimeGenerated)
|
||||
.ToList();
|
||||
await App.MainDispatcher.BeginInvoke(() => {
|
||||
EventList.ItemsSource = list;
|
||||
EventList.SelectedIndex = 0;
|
||||
});
|
||||
});
|
||||
Mouse.OverrideCursor = null;
|
||||
}
|
||||
|
||||
private void EventList_SelectionChanged(object sender, RoutedEventArgs evt) {
|
||||
|
Reference in New Issue
Block a user