private HistoryItem[] GetHistoryItems() { IEnumerable <HistoryItem> tempHistoryItems = history.GetHistoryItems(); if (MaxItemCount > -1) { int skip = tempHistoryItems.Count() - MaxItemCount; if (skip > 0) { tempHistoryItems = tempHistoryItems.Skip(skip); } } return(tempHistoryItems.OrderByDescending(x => x.DateTimeUtc).ToArray()); }
private HistoryItem[] GetHistoryItems() { IEnumerable <HistoryItem> tempHistoryItems = history.GetHistoryItems().Where(x => !string.IsNullOrEmpty(x.Filepath) && Helpers.IsImageFile(x.Filepath) && File.Exists(x.Filepath)); if (MaxItemCount > -1) { int skip = tempHistoryItems.Count() - MaxItemCount; if (skip > 0) { tempHistoryItems = tempHistoryItems.Skip(skip); } } return(tempHistoryItems.OrderByDescending(x => x.DateTimeUtc).ToArray()); }