/// <summary> /// Applies a <see cref="PaginatorAction"/> to the <see cref="Paginator"/>. /// </summary> /// <param name="action"></param> /// <returns></returns> public virtual Task <bool> ApplyActionAsync(PaginatorAction action) { switch (action) { case PaginatorAction.Backward: return(SetPageAsync(CurrentPageIndex - 1)); case PaginatorAction.Forward: return(SetPageAsync(CurrentPageIndex + 1));; case PaginatorAction.SkipToStart: return(SetPageAsync(0)); case PaginatorAction.SkipToEnd: return(SetPageAsync(MaxPageIndex)); default: return(Task.FromResult(false)); } }
/// <summary> /// Adds an emote related to a action to the <see cref="Paginator"/>. /// </summary> /// <returns></returns> public new StaticPaginatorBuilder AddEmote(PaginatorAction action, IEmote emote) => base.AddEmote(action, emote) as StaticPaginatorBuilder;
/// <summary> /// Adds an emote related to a action to the <see cref="Paginator"/>. /// </summary> /// <returns></returns> public new LazyPaginatorBuilder AddEmote(PaginatorAction action, IEmote emote) => base.AddEmote(action, emote) as LazyPaginatorBuilder;
protected PaginatorBuilder AddEmote(PaginatorAction action, IEmote emote) { Emotes.Add(emote, action); return(this); }