Skip to content

Commit

Permalink
AI: fix English comments created by non-native speaker (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr committed Jan 5, 2024
1 parent c257720 commit 1e7f5df
Show file tree
Hide file tree
Showing 80 changed files with 762 additions and 657 deletions.
4 changes: 2 additions & 2 deletions Havit.Blazor.Components.Web.Bootstrap/Chips/ChipItem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Havit.Blazor.Components.Web.Bootstrap;

/// <summary>
/// Chip item to be rendered in UI.
/// Chip item to be rendered in the UI.
/// </summary>
public class ChipItem
{
Expand All @@ -16,7 +16,7 @@ public class ChipItem
public bool Removable { get; init; } = false;

/// <summary>
/// Remove action called when chip should be removed.
/// Remove action called when the chip should be removed.
/// It receives the model from which the chip should be removed.
/// It is not the same instance as the one from which the chip was generated!
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Havit.Blazor.Components.Web.Bootstrap;

/// <summary>
/// Settings for the <see cref="HxChipList"/> component.
/// </summary>
public class ChipListSettings
{
/// <summary>
Expand All @@ -13,7 +16,7 @@ public class ChipListSettings
public string CssClass { get; set; }

/// <summary>
/// Enables/disables the reset button.
/// Enables or disables the reset button.
/// </summary>
public bool? ShowResetButton { get; set; }
}
24 changes: 12 additions & 12 deletions Havit.Blazor.Components.Web.Bootstrap/Chips/HxChipList.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

/// <summary>
/// Presents a list of chips as badges.<br/>
/// Usually being used to present filter-criteria gathered by <see cref="HxFilterForm{TModel}"/>.<br />
/// Usually used to present filter criteria gathered by <see cref="HxFilterForm{TModel}"/>.<br />
/// Full documentation and demos: <see href="https://havit.blazor.eu/components/HxChipList">https://havit.blazor.eu/components/HxChipList</see>
/// </summary>
public partial class HxChipList
{
/// <summary>
/// Application-wide defaults for the <see cref="HxChipList"/>.
/// Application-wide defaults for the <see cref="HxChipList"/> component.
/// </summary>
public static ChipListSettings Defaults { get; set; }

Expand All @@ -25,8 +25,8 @@ static HxChipList()
}

/// <summary>
/// Returns application-wide defaults for the component.
/// Enables overriding defaults in descendants (use separate set of defaults).
/// Returns the application-wide defaults for the component.
/// Enables overriding defaults in descendants (use a separate set of defaults).
/// </summary>
protected virtual ChipListSettings GetDefaults() => Defaults;

Expand All @@ -36,10 +36,10 @@ static HxChipList()
[Parameter] public ChipListSettings Settings { get; set; }

/// <summary>
/// Returns optional set of component settings.
/// Returns an optional set of component settings.
/// </summary>
/// <remarks>
/// Similar to <see cref="GetDefaults"/>, enables defining wider <see cref="Settings"/> in components descendants (by returning a derived settings class).
/// Similar to <see cref="GetDefaults"/>, enables defining wider <see cref="Settings"/> in component descendants (by returning a derived settings class).
/// </remarks>
protected virtual ChipListSettings GetSettings() => this.Settings;

Expand All @@ -50,7 +50,7 @@ static HxChipList()

/// <summary>
/// Settings for the <see cref="HxBadge"/> used to render chips.
/// Default brings <c>Color="<see cref="ThemeColor.Secondary" />".</c>
/// The default brings <c>Color="<see cref="ThemeColor.Secondary" />".</c>
/// </summary>
[Parameter] public BadgeSettings ChipBadgeSettings { get; set; }
protected BadgeSettings ChipBadgeSettingsEffective => this.ChipBadgeSettings ?? this.GetSettings()?.ChipBadgeSettings ?? this.GetDefaults().ChipBadgeSettings ?? throw new InvalidOperationException(nameof(ChipBadgeSettings) + " default for " + nameof(HxChipList) + " has to be set.");
Expand All @@ -62,7 +62,7 @@ static HxChipList()
protected string CssClassEffective => this.CssClass ?? this.GetSettings()?.CssClass ?? GetDefaults().CssClass;

/// <summary>
/// Called when chip remove button is clicked.
/// Called when the chip remove button is clicked.
/// </summary>
[Parameter] public EventCallback<ChipItem> OnChipRemoveClick { get; set; }

Expand All @@ -82,8 +82,8 @@ static HxChipList()
protected virtual Task InvokeOnResetClickAsync() => OnResetClick.InvokeAsync();

/// <summary>
/// Enables/disables the reset button.
/// Default is <c>false</c> (can be changed with <code>HxChipList.Defaults.ShowResetButton</code>.
/// Enables or disables the reset button.
/// The default is <c>false</c> (can be changed with <code>HxChipList.Defaults.ShowResetButton</code>).
/// </summary>
[Parameter] public bool? ShowResetButton { get; set; }
protected bool ShowResetButtonEffective => this.ShowResetButton ?? this.GetSettings()?.ShowResetButton ?? GetDefaults().ShowResetButton ?? throw new InvalidOperationException(nameof(ShowResetButton) + " default for " + nameof(HxChipList) + " has to be set.");
Expand All @@ -95,7 +95,7 @@ static HxChipList()

/// <summary>
/// Template for the reset button.
/// If used, the <see cref="ResetButtonText"/> is ignored and the <see cref="OnResetClick"/> callback is not triggered (you are expected to wire the reset logic on you own).
/// If used, the <see cref="ResetButtonText"/> is ignored and the <see cref="OnResetClick"/> callback is not triggered (you are expected to wire the reset logic on your own).
/// </summary>
[Parameter] public RenderFragment ResetButtonTemplate { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace Havit.Blazor.Components.Web.Bootstrap;

/// <summary>
/// Used in a component which can generate chips.
/// Used in a component that can generate chips.
/// </summary>
public interface IHxChipGenerator
{
/// <summary>
/// Get chips from the component.
/// </summary>
IEnumerable<ChipItem> GetChips();
}
}
8 changes: 4 additions & 4 deletions Havit.Blazor.Components.Web.Bootstrap/HxSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ namespace Havit.Blazor.Components.Web.Bootstrap;
public static class HxSetup
{
/// <summary>
/// Renders <c>&lt;script&lt;</c> tag referencing corresponding Bootstrap JavaScript bundle with Popper.<br/>
/// Renders <c>&lt;script&lt;</c> tag referencing the corresponding Bootstrap JavaScript bundle with Popper.<br/>
/// To be used in <c>_Layout.cshtml</c> as <c>@Html.Raw(HxSetup.RenderBootstrapJavaScriptReference())</c>.
/// </summary>
/// <remarks>
/// We do not want to use TagHelper nor HTML Helper here as we do not want to introduce dependency on server-side ASP.NET Core (MVC/Razor) to our library (separate NuGet package would have to be created).
/// We do not want to use TagHelper or HTML Helper here as we do not want to introduce a dependency on server-side ASP.NET Core (MVC/Razor) to our library (a separate NuGet package would have to be created).
/// </remarks>
public static string RenderBootstrapJavaScriptReference()
{
return "<script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL\" crossorigin=\"anonymous\"></script>";
}

/// <summary>
/// Renders <c>&lt;link&lt;</c> tag referencing corresponding Bootstrap CSS.<br/>
/// Renders <c>&lt;link&lt;</c> tag referencing the corresponding Bootstrap CSS.<br/>
/// To be used in <c>_Layout.cshtml</c> as <c>@Html.Raw(HxSetup.RenderBootstrapCssReference())</c>.
/// </summary>
/// <remarks>
/// We do not want to use TagHelper nor HTML Helper here as we do not want to introduce dependency on server-side ASP.NET Core (MVC/Razor) to our library (separate NuGet package would have to be created).
/// We do not want to use TagHelper or HTML Helper here as we do not want to introduce a dependency on server-side ASP.NET Core (MVC/Razor) to our library (a separate NuGet package would have to be created).
/// </remarks>
public static string RenderBootstrapCssReference(BootstrapFlavor bootstrapFlavor = BootstrapFlavor.HavitDefault)
{
Expand Down
6 changes: 3 additions & 3 deletions Havit.Blazor.Components.Web.Bootstrap/Icons/BootstrapIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Bootstrap icon.
/// </summary>
/// <remarks>
/// To bootstrap icons update you need:
/// To update bootstrap icons, perform the following steps:
/// - Update wwwroot\fonts\bootstrap-icons.woff
/// - Update wwwroot\fonts\bootstrap-icons.woff2
/// - Update wwwroot\bootstrap-icons.css
Expand All @@ -22,13 +22,13 @@ public partial class BootstrapIcon : IconBase
public string Name { get; set; }

/// <summary>
/// Constructor. Private.
/// Private constructor.
/// </summary>
private BootstrapIcon(string name)
{
Name = name;
}

// Next members are generated using a source generator.
// Tho source for the generator is the bootstrap-icons.json file located next to this one.
// The source for the generator is the bootstrap-icons.json file located next to this one.
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
namespace Havit.Blazor.Components.Web.Bootstrap;

/// <summary>
/// Displays bootstrap icon. See <see href="https://icons.getbootstrap.com/">https://icons.getbootstrap.com/</see>.
/// Displays a bootstrap icon. See <see href="https://icons.getbootstrap.com/">https://icons.getbootstrap.com/</see>.
/// You usually don't use this component directly, but instead use <see cref="HxIcon" />.
/// </summary>
internal class HxBootstrapIcon : ComponentBase
{
/// <summary>
/// Icon to display.
/// The icon to display.
/// </summary>
[Parameter] public BootstrapIcon Icon { get; set; }

/// <summary>
/// CSS Class to combine with basic icon CSS class.
/// The CSS class to combine with the basic icon CSS class.
/// </summary>
[Parameter] public string CssClass { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static HxListLayout()
}

/// <summary>
/// Can be used for TFilterModelType to express there is no filter in the <see cref="HxListLayout"/> component.
/// Can be used for TFilterModelType to indicate that there is no filter in the <see cref="HxListLayout"/> component.
/// </summary>
public sealed class NoFilter { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
namespace Havit.Blazor.Components.Web.Bootstrap;

/// <summary>
/// Data presentation component composed of <see cref="HxGrid"/> for data, <see cref="HxOffcanvas"/> for manual filtering and <see cref="HxNamedViewList{T}"/> for pre-defined filters.<br />
/// Data presentation component composed of <see cref="HxGrid"/> for data, <see cref="HxOffcanvas"/> for manual filtering, and <see cref="HxNamedViewList{T}"/> for pre-defined filters.<br />
/// Full documentation and demos: <see href="https://havit.blazor.eu/components/HxListLayout">https://havit.blazor.eu/components/HxListLayout</see>
/// </summary>
/// <typeparam name="TFilterModel"></typeparam>
public partial class HxListLayout<TFilterModel>
{
/// <summary>
/// Returns <see cref="HxMessageBox"/> defaults.
/// Enables overriding defaults in descendants (use separate set of defaults).
/// Returns the <see cref="HxMessageBox"/> defaults.
/// Enables overriding defaults in descendants (use a separate set of defaults).
/// </summary>
protected virtual ListLayoutSettings GetDefaults() => HxListLayout.Defaults;

Expand All @@ -21,10 +21,10 @@ public partial class HxListLayout<TFilterModel>
[Parameter] public ListLayoutSettings Settings { get; set; }

/// <summary>
/// Returns optional set of component settings.
/// Returns an optional set of component settings.
/// </summary>
/// <remarks>
/// Similar to <see cref="GetDefaults"/>, enables defining wider <see cref="Settings"/> in components descendants (by returning a derived settings class).
/// Similar to <see cref="GetDefaults"/>, enables defining wider <see cref="Settings"/> in component descendants (by returning a derived settings class).
/// </remarks>
protected virtual ListLayoutSettings GetSettings() => this.Settings;

Expand Down Expand Up @@ -58,7 +58,7 @@ public partial class HxListLayout<TFilterModel>
protected CardSettings CardSettingsEffective => this.CardSettings ?? GetSettings()?.CardSettings ?? GetDefaults().CardSettings ?? throw new InvalidOperationException(nameof(CardSettings) + " default for " + nameof(HxListLayout) + " has to be set.");

/// <summary>
/// Settings for the <see cref="HxButton"/> opening filtering offcanvas.
/// Settings for the <see cref="HxButton"/> opening the filtering offcanvas.
/// </summary>
[Parameter] public ButtonSettings FilterOpenButtonSettings { get; set; }
protected ButtonSettings FilterOpenButtonSettingsEffective => this.FilterOpenButtonSettings ?? GetSettings()?.FilterOpenButtonSettings ?? GetDefaults().FilterOpenButtonSettings ?? throw new InvalidOperationException(nameof(FilterOpenButtonSettings) + " default for " + nameof(HxListLayout) + " has to be set.");
Expand Down Expand Up @@ -92,7 +92,7 @@ protected override void OnParametersSet()
{
base.OnParametersSet();

Contract.Requires<InvalidOperationException>((FilterTemplate is null) || (FilterModel is not null), $"{nameof(HxListLayout)} requires {nameof(FilterModel)} to be set if {nameof(FilterTemplate)} is used.");
Contract.Requires<InvalidOperationException>((FilterTemplate is null) || (FilterModel is not null), $"{nameof(HxListLayout)} requires {nameof(FilterModel)} to be set if {nameof(FilterTemplate)} is used.");
}

private void HandleChipUpdated(ChipItem[] chips)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@
public interface ILayoutColumnComponent
{
/// <summary>
/// Number of template columns to span. Responsive setting for all devices including the extra-small ones (XS) bellow "small" breakpoint (<c>576px</c>).<br />
/// Number of template columns to span. Responsive setting for all devices including the extra-small ones (XS) below "small" breakpoint (<c>576px</c>).<br />
/// The value can be any integer number between <c>1</c> and <c>12</c> (<c>.col-1</c>), <c>auto</c> (<c>.col-auto</c>) or <c>true</c> (<c>.col</c>).
/// </summary>
string Columns { get; set; }

/// <summary>
/// Number of template columns to span for viewports above "small" breakpoint (<c>576px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c> or <c>true</c>.
/// Number of template columns to span for viewports above the "small" breakpoint (<c>576px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c>, or <c>true</c>.
/// </summary>
string ColumnsSmallUp { get; set; }

/// <summary>
/// Number of template columns to span for viewports above "medium" breakpoint (<c>768px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c> or <c>true</c>.
/// Number of template columns to span for viewports above the "medium" breakpoint (<c>768px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c>, or <c>true</c>.
/// </summary>
string ColumnsMediumUp { get; set; }

/// <summary>
/// Number of template columns to span for viewports above "large" breakpoint (<c>992px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c> or <c>true</c>.
/// Number of template columns to span for viewports above the "large" breakpoint (<c>992px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c>, or <c>true</c>.
/// </summary>
string ColumnsLargeUp { get; set; }

/// <summary>
/// Number of template columns to span for viewports above "large" breakpoint (<c>1200px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c> or <c>true</c>.
/// Number of template columns to span for viewports above the "extra-large" breakpoint (<c>1200px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c>, or <c>true</c>.
/// </summary>
string ColumnsExtraLargeUp { get; set; }

/// <summary>
/// Number of template columns to span for viewports above "XXL" breakpoint (<c>1400px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c> or <c>true</c>.
/// Number of template columns to span for viewports above the "XXL" breakpoint (<c>1400px</c>).<br/>
/// The value can be any integer number between <c>1</c> and <c>12</c>, <c>auto</c>, or <c>true</c>.
/// </summary>
string ColumnsXxlUp { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public static class LayoutColumnComponentExtensions
{
/// <summary>
/// Returns CSS classes representing column layout of the component.
/// Returns CSS classes representing the column layout of the component.
/// </summary>
public static string GetColumnsCssClasses(this ILayoutColumnComponent columnComponent)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public record ListLayoutSettings
public CardSettings CardSettings { get; set; }

/// <summary>
/// Settings for the <see cref="HxButton"/> opening filtering offcanvas.
/// Settings for the <see cref="HxButton"/> that opens the filtering offcanvas.
/// </summary>
public ButtonSettings FilterOpenButtonSettings { get; set; }

/// <summary>
/// Settings for the <see cref="HxButton"/> submitting the filter.
/// Settings for the <see cref="HxButton"/> that submits the filter.
/// </summary>
public ButtonSettings FilterSubmitButtonSettings { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public partial class HxListGroupItem
[Parameter] public RenderFragment ChildContent { get; set; }

/// <summary>
/// Indicates the current active selection.
/// Indicates the currently active selection.
/// </summary>
[Parameter] public bool Active { get; set; }

/// <summary>
/// Make the item appear disabled by setting to <c>false</c>.
/// Default is <c>true</c>.
/// Make the item appear disabled by setting it to <c>false</c>.
/// The default value is <c>true</c>.
/// </summary>
[Parameter] public bool Enabled { get; set; } = true;

Expand Down
Loading

0 comments on commit 1e7f5df

Please sign in to comment.