I have no idea anymore why I needed this function
This commit is contained in:
parent
3a5d4dd60f
commit
8f9e1b1429
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user