Skip to content

Commit

Permalink
Merge pull request #305 from adschmu/work/comments
Browse files Browse the repository at this point in the history
Improve docstring formatting
  • Loading branch information
a-gubskiy authored Oct 16, 2024
2 parents 0e4bdac + d9d0d1f commit 6a7ca61
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 177 deletions.
44 changes: 22 additions & 22 deletions src/X.PagedList.Mvc.Core/GoToFormRenderOptions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace X.PagedList.Mvc.Core;

///<summary>
/// <summary>
/// Options for configuring the output of <see cref = "HtmlHelper" />.
///</summary>
/// </summary>
public class GoToFormRenderOptions
{
///<summary>
/// <summary>
/// The default settings, with configurable querystring key (input field name).
///</summary>
/// </summary>
public GoToFormRenderOptions(string inputFieldName)
{
LabelFormat = "Go to page:";
Expand All @@ -16,48 +16,48 @@ public GoToFormRenderOptions(string inputFieldName)
InputFieldType = "number";
}

///<summary>
/// <summary>
/// The default settings.
///</summary>
/// </summary>
public GoToFormRenderOptions() : this("page")
{
}

///<summary>
/// <summary>
/// The text to show in the form's input label.
///</summary>
///<example>
/// </summary>
/// <example>
/// "Go to page:"
///</example>
/// </example>
public string LabelFormat { get; set; }

///<summary>
/// <summary>
/// The text to show in the form's submit button.
///</summary>
///<example>
/// </summary>
/// <example>
/// "Go"
///</example>
/// </example>
public string SubmitButtonFormat { get; set; }

/// <summary>
/// Submit button width in px
/// </summary>
public int SubmitButtonWidth { get; set; }

///<summary>
/// <summary>
/// The querystring key this form should submit the new page number as.
///</summary>
///<example>
/// </summary>
/// <example>
/// "page"
///</example>
/// </example>
public string InputFieldName { get; set; }

///<summary>
/// <summary>
/// The HTML input type for this field. Defaults to the HTML5 "number" type, but can be changed to "text" if targetting previous versions of HTML.
///</summary>
///<example>
/// </summary>
/// <example>
/// "number"
///</example>
/// </example>
public string InputFieldType { get; set; }

/// <summary>
Expand Down
76 changes: 38 additions & 38 deletions src/X.PagedList.Mvc.Core/HtmlHelperExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@

namespace X.PagedList.Mvc.Core;

///<summary>
/// Extension methods for generating paging controls that can operate on instances of IPagedList.
///</summary>
/// <summary>
/// Extension methods for generating paging controls that can operate on instances of IPagedList.
/// </summary>
[PublicAPI]
public static class HtmlHelperExtension
{
///<summary>
/// Displays a configurable paging control for instances of PagedList.
///</summary>
///<param name = "html">This method is meant to hook off HtmlHelper as an extension method.</param>
///<param name = "list">The PagedList to use as the data source.</param>
///<param name = "generatePageUrl">A function that takes the page number of the desired page and returns a URL-string that will load that page.</param>
///<returns>Outputs the paging control HTML.</returns>
/// <summary>
/// Displays a configurable paging control for instances of PagedList.
/// </summary>
/// <param name = "html">This method is meant to hook off HtmlHelper as an extension method.</param>
/// <param name = "list">The PagedList to use as the data source.</param>
/// <param name = "generatePageUrl">A function that takes the page number of the desired page and returns a URL-string that will load that page.</param>
/// <returns>Outputs the paging control HTML.</returns>
public static HtmlString PagedListPager(this IHtmlHelper html,
IPagedList? list,
Func<int, string?> generatePageUrl)
{
return PagedListPager(html, list, generatePageUrl, new PagedListRenderOptions());
}

///<summary>
/// Displays a configurable paging control for instances of PagedList.
///</summary>
///<param name = "html">This method is meant to hook off HtmlHelper as an extension method.</param>
///<param name = "list">The PagedList to use as the data source.</param>
///<param name = "generatePageUrl">A function that takes the page number of the desired page and returns a URL-string that will load that page.</param>
///<param name = "options">Formatting options.</param>
///<returns>Outputs the paging control HTML.</returns>
/// <summary>
/// Displays a configurable paging control for instances of PagedList.
/// </summary>
/// <param name = "html">This method is meant to hook off HtmlHelper as an extension method.</param>
/// <param name = "list">The PagedList to use as the data source.</param>
/// <param name = "generatePageUrl">A function that takes the page number of the desired page and returns a URL-string that will load that page.</param>
/// <param name = "options">Formatting options.</param>
/// <returns>Outputs the paging control HTML.</returns>
public static HtmlString PagedListPager(this IHtmlHelper html,
IPagedList? list,
Func<int, string?> generatePageUrl,
Expand All @@ -47,26 +47,26 @@ public static HtmlString PagedListPager(this IHtmlHelper html,
return new HtmlString(htmlString);
}

///<summary>
/// <summary>
/// Displays a configurable "Go To Page:" form for instances of PagedList.
///</summary>
///<param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
///<param name="list">The PagedList to use as the data source.</param>
///<param name="formAction">The URL this form should submit the GET request to.</param>
///<returns>Outputs the "Go To Page:" form HTML.</returns>
/// </summary>
/// <param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
/// <param name="list">The PagedList to use as the data source.</param>
/// <param name="formAction">The URL this form should submit the GET request to.</param>
/// <returns>Outputs the "Go To Page:" form HTML.</returns>
public static HtmlString PagedListGoToPageForm(this IHtmlHelper html, IPagedList list, string formAction)
{
return PagedListGoToPageForm(html, list, formAction, "page");
}

///<summary>
/// <summary>
/// Displays a configurable "Go To Page:" form for instances of PagedList.
///</summary>
///<param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
///<param name="list">The PagedList to use as the data source.</param>
///<param name="formAction">The URL this form should submit the GET request to.</param>
///<param name="inputFieldName">The querystring key this form should submit the new page number as.</param>
///<returns>Outputs the "Go To Page:" form HTML.</returns>
/// </summary>
/// <param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
/// <param name="list">The PagedList to use as the data source.</param>
/// <param name="formAction">The URL this form should submit the GET request to.</param>
/// <param name="inputFieldName">The querystring key this form should submit the new page number as.</param>
/// <returns>Outputs the "Go To Page:" form HTML.</returns>
public static HtmlString PagedListGoToPageForm(this IHtmlHelper html,
IPagedList list,
string formAction,
Expand All @@ -75,14 +75,14 @@ public static HtmlString PagedListGoToPageForm(this IHtmlHelper html,
return PagedListGoToPageForm(html, list, formAction, new GoToFormRenderOptions(inputFieldName));
}

///<summary>
/// <summary>
/// Displays a configurable "Go To Page:" form for instances of PagedList.
///</summary>
///<param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
///<param name="list">The PagedList to use as the data source.</param>
///<param name="formAction">The URL this form should submit the GET request to.</param>
///<param name="options">Formatting options.</param>
///<returns>Outputs the "Go To Page:" form HTML.</returns>
/// </summary>
/// <param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
/// <param name="list">The PagedList to use as the data source.</param>
/// <param name="formAction">The URL this form should submit the GET request to.</param>
/// <param name="options">Formatting options.</param>
/// <returns>Outputs the "Go To Page:" form HTML.</returns>
public static HtmlString PagedListGoToPageForm(this IHtmlHelper html,
IPagedList list,
string formAction,
Expand Down
Loading

0 comments on commit 6a7ca61

Please sign in to comment.