/// <summary> /// Process the result to update enumerator's state. /// </summary> /// <param name="result"></param> private void ProcessResult(PageReadResult?result, DateDirection dateDirection) { if (result == null || !result.Successful) { CanMoveNext = false; CanMovePrevious = false; } else if (result.SongsOnPage > 0) { CurrentLatest = result.FirstSong.UploadDate; CurrentEarliest = result.LastSong.UploadDate; if (dateDirection == DateDirection.Before) { CanMoveNext = true; } else { CanMovePrevious = true; } } else { if (dateDirection == DateDirection.Before) { CanMoveNext = false; } else { CanMovePrevious = false; } } }
public static DateTime Date(DateDirection direction) { return(direction == DateDirection.Past ? new DateTime(Int(1990, DateTime.Now.Year), Int(1, 12), Int(1, 28)) : new DateTime(Int(DateTime.Now.Year, 2020), Int(1, 12), Int(1, 28))); }
public FeedDate(DateTime dateTime, DateDirection direction) { Date = dateTime; Direction = direction; }
public static DateTime Date(DateDirection direction) { return direction == DateDirection.Past ? new DateTime(Int(1990, DateTime.Now.Year), Int(1, 12), Int(1, 28)) : new DateTime(Int(DateTime.Now.Year, 2020), Int(1, 12), Int(1, 28)); }