I have no idea anymore why I needed this function

This commit is contained in:
Florian Stinglmayr 2022-08-24 09:48:56 +02:00
parent 3a5d4dd60f
commit 8f9e1b1429

View File

@ -62,5 +62,28 @@ namespace EDJournal {
journalfiles.Sort();
}
public Entry FindMostRecent(string entry) {
var entries = journalfiles
.OrderByDescending(x => x.DateTime)
.ToArray()
;
if (entries == null || entries.Length == 0) {
return null;
}
foreach(JournalFile file in entries) {
Entry found = file.Entries
.OrderByDescending(x => x.Timestamp)
.First(x => x.Event == entry)
;
if (found != null) {
return found;
}
}
return null;
}
}
}