Elwig: Add LogWindow
All checks were successful
Test / Run tests (push) Successful in 1m49s

This commit is contained in:
2024-09-22 12:09:34 +02:00
parent 3cde360aaa
commit 526e951029
5 changed files with 94 additions and 0 deletions

View File

@ -539,6 +539,16 @@ namespace Elwig.Helpers {
}
}
public static List<EventLogEntry> GetLogEntries() {
using var log = new EventLog {
Log = "Application",
Source = ".NET Runtime",
};
return log.Entries.Cast<EventLogEntry>()
.Where(e => e.Message.StartsWith("Application: Elwig.exe"))
.ToList();
}
public static int GetEntityIdetifierForPk(params object?[] primaryKey) {
var pk = primaryKey.Select(k => k?.GetHashCode() ?? 0).ToArray();
return ((IStructuralEquatable)pk).GetHashCode(EqualityComparer<int>.Default);