Represent as a pager.
コード例 #1
0
        /// <summary>
        ///     Generate the entire HTML content for a pager renderling list.
        /// </summary>
        /// <returns>The entire HTML content for the generated pager.</returns>
        public IHtmlContent GeneratePager(PagerGenerationContext context)
        {
            // Hide Handling
            if (context.TotalPage <= 1 && context.Options.HideOnSinglePage)
            {
                return(new HtmlString(string.Empty));
            }

            var list = ListGenerator.GeneratePagerItems(context);

            // Reverse handling
            if (context.Options.IsReversed)
            {
                list = new PagerList(list.Items.Reverse());
            }

            var renderingList = RenderingListGenerator.GenerateRenderingList(list, context);
            var html          = HtmlGenerator.GeneratePager(renderingList, context);

            return(html);
        }
コード例 #2
0
		/// <summary>
		///     Generate the entire HTML content for a pager renderling list.
		/// </summary>
		/// <returns>The entire HTML content for the generated pager.</returns>
		public IHtmlContent GeneratePager(PagerGenerationContext context)
		{
			// Hide Handling
			if (context.TotalPage <= 1 && context.Options.HideOnSinglePage)
			{
				return new HtmlString(string.Empty);
			}

			var list = ListGenerator.GeneratePagerItems(context);

			// Reverse handling
			if (context.Options.IsReversed)
			{
				list = new PagerList(list.Items.Reverse());
			}

			var renderingList = RenderingListGenerator.GenerateRenderingList(list, context);
			var html = HtmlGenerator.GeneratePager(renderingList, context);

			return html;
		}
コード例 #3
0
 /// <summary>
 ///     Build a <see cref="PagerRenderingList" /> according to the <see cref="PagerGenerationContext" /> information.
 /// </summary>
 /// <param name="list">The <see cref="PagerList" /> which contains all pager items.</param>
 /// <param name="context">The <see cref="PagerGenerationContext" /> object which includes all the informations needed.</param>
 /// <returns>A <see cref="PagerRenderingList" /> object which represent as a list to ge displayed in the page.</returns>
 public PagerRenderingList GenerateRenderingList(PagerList list, PagerGenerationContext context)
 {
     return(GenerateRenderingListCore(list.Items, context));
 }
コード例 #4
0
		/// <summary>
		///     Build a <see cref="PagerRenderingList" /> according to the <see cref="PagerGenerationContext" /> information.
		/// </summary>
		/// <param name="list">The <see cref="PagerList" /> which contains all pager items.</param>
		/// <param name="context">The <see cref="PagerGenerationContext" /> object which includes all the informations needed.</param>
		/// <returns>A <see cref="PagerRenderingList" /> object which represent as a list to ge displayed in the page.</returns>
		public PagerRenderingList GenerateRenderingList(PagerList list, PagerGenerationContext context)
		{
			return GenerateRenderingListCore(list.Items, context);
		}