コード例 #1
0
        /// <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));
            }
        }
コード例 #2
0
 /// <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;
コード例 #3
0
 /// <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;
コード例 #4
0
 protected PaginatorBuilder AddEmote(PaginatorAction action, IEmote emote)
 {
     Emotes.Add(emote, action);
     return(this);
 }