Skip to content

Commit cb8af04

Browse files
authored
Enhance API docs and metadata for GoogleMap, Markdown, Modal (#1222)
Added [AddedVersion], [DefaultValue], [Description], and [ParameterTypeName] attributes to public properties and methods in GoogleMap, Markdown, and Modal components. Improved XML documentation with clearer default values and descriptions. Updated several parameters to be nullable where appropriate. These changes improve API discoverability, tooling support, and overall self-documentation. No functional logic was changed.
1 parent fd2ddc2 commit cb8af04

File tree

3 files changed

+249
-94
lines changed

3 files changed

+249
-94
lines changed

blazorbootstrap/Components/Maps/GoogleMap.razor.cs

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ protected override async Task OnInitializedAsync()
2222
/// </summary>
2323
/// <param name="marker">The marker to add to the map.</param>
2424
/// <returns>A completed task.</returns>
25+
[AddedVersion("3.0.0")]
26+
[Description("Adds a marker to the GoogleMap.")]
2527
public ValueTask AddMarkerAsync(GoogleMapMarker marker)
2628
{
2729
JSRuntime.InvokeVoidAsync("window.blazorBootstrap.googlemaps.addMarker", Id, marker, objRef);
@@ -40,6 +42,8 @@ public async Task OnMarkerClickJS(GoogleMapMarker marker)
4042
/// Refreshes the Google Map component.
4143
/// </summary>
4244
/// <returns>A completed task.</returns>
45+
[AddedVersion("3.0.0")]
46+
[Description("Refreshes the Google Map component.")]
4347
public ValueTask RefreshAsync()
4448
{
4549
JSRuntime.InvokeVoidAsync("window.blazorBootstrap.googlemaps.initialize", Id, Zoom, Center, Markers, Clickable, objRef);
@@ -51,6 +55,8 @@ public ValueTask RefreshAsync()
5155
/// Updates the markers on the Google Map.
5256
/// </summary>
5357
/// <returns>A completed task.</returns>
58+
[AddedVersion("3.0.0")]
59+
[Description("Updates the markers on the Google Map.")]
5460
public ValueTask UpdateMarkersAsync(IEnumerable<GoogleMapMarker> markers)
5561
{
5662
JSRuntime.InvokeVoidAsync("window.blazorBootstrap.googlemaps.updateMarkers", Id, markers, objRef);
@@ -76,79 +82,125 @@ private void OnScriptLoad()
7682

7783
/// <summary>
7884
/// Gets or sets the Google Map API key.
85+
/// <para>
86+
/// Default value is <see langword="null" />.
87+
/// </para>
7988
/// </summary>
89+
[AddedVersion("3.0.0")]
90+
[DefaultValue(null)]
91+
[Description("Gets or sets the Google Map API key.")]
92+
[ParameterTypeName("string?")]
8093
[Parameter]
8194
public string? ApiKey { get; set; }
8295

8396
/// <summary>
8497
/// Gets or sets the center parameter.
98+
/// <para>
99+
/// Default value is <see langword="null" />.
100+
/// </para>
85101
/// </summary>
102+
[AddedVersion("3.0.0")]
103+
[DefaultValue(null)]
104+
[Description("Gets or sets the center parameter.")]
105+
[ParameterTypeName("GoogleMapCenter?")]
86106
[Parameter]
87-
public GoogleMapCenter Center { get; set; } = default!;
107+
public GoogleMapCenter? Center { get; set; }
88108

89109
/// <summary>
90110
/// Makes the marker clickable if set to <see langword="true" />.
111+
/// <para>
112+
/// Default value is <see langword="false" />.
113+
/// </para>
91114
/// </summary>
115+
[AddedVersion("3.0.0")]
116+
[DefaultValue(false)]
117+
[Description("Makes the marker clickable if set to <b>true</b>.")]
92118
[Parameter]
93119
public bool Clickable { get; set; }
94120

95121
private string? GoogleMapsJsFileUrl => $"https://maps.googleapis.com/maps/api/js?key={ApiKey}&libraries=maps,marker";
96122

97123
/// <summary>
98124
/// Gets or sets the height of the <see cref="GoogleMap" />.
99-
/// </summary>
100-
/// <remarks>
125+
/// <para>
101126
/// Default value is <see langword="null" />.
102-
/// </remarks>
127+
/// </para>
128+
/// </summary>
129+
[AddedVersion("3.0.0")]
130+
[DefaultValue(null)]
131+
[Description("Gets or sets the height of the <b>GoogleMap</b>.")]
132+
[ParameterTypeName("double?")]
103133
[Parameter]
104134
public double? Height { get; set; }
105135

106136
/// <summary>
107137
/// Gets or sets the units for the <see cref="Height" />.
108-
/// </summary>
109-
/// <remarks>
138+
/// <para>
110139
/// Default value is <see cref="Unit.Px" />.
111-
/// </remarks>
140+
/// </para>
141+
/// </summary>
142+
[AddedVersion("3.0.0")]
143+
[DefaultValue(Unit.Px)]
144+
[Description("Gets or sets the units for the <b>Height</b>.")]
112145
[Parameter]
113146
public Unit HeightUnit { get; set; } = Unit.Px;
114147

115148
/// <summary>
116149
/// Gets or sets the markers.
150+
/// <para>
151+
/// Default value is <see langword="null" />.
152+
/// </para>
117153
/// </summary>
154+
[AddedVersion("3.0.0")]
155+
[DefaultValue(null)]
156+
[Description("Gets or sets the markers.")]
157+
[ParameterTypeName("IEnumerable<GoogleMapMarker>?")]
118158
[Parameter]
119159
public IEnumerable<GoogleMapMarker>? Markers { get; set; }
120160

121161
/// <summary>
122162
/// Event fired when a user clicks on a marker.
123163
/// This event fires only when <see cref="Clickable" /> is set to <see langword="true" />.
124164
/// </summary>
165+
[AddedVersion("3.0.0")]
166+
[Description("Event fired when a user clicks on a marker. This event fires only when <b>Clickable</b> is set to <b>true</b>.")]
125167
[Parameter]
126168
public EventCallback<GoogleMapMarker> OnMarkerClick { get; set; }
127169

128170
/// <summary>
129171
/// Gets or sets the width of the <see cref="GoogleMap" />.
130-
/// </summary>
131-
/// <remarks>
172+
/// <para>
132173
/// Default value is <see langword="null" />.
133-
/// </remarks>
174+
/// </para>
175+
/// </summary>
176+
[AddedVersion("3.0.0")]
177+
[DefaultValue(null)]
178+
[Description("Gets or sets the width of the <b>GoogleMap</b>.")]
179+
[ParameterTypeName("double?")]
134180
[Parameter]
135181
public double? Width { get; set; }
136182

137183
/// <summary>
138184
/// Gets or sets the units for the <see cref="Width" />.
139-
/// </summary>
140-
/// <remarks>
185+
/// <para>
141186
/// Default value is <see cref="Unit.Percentage" />.
142-
/// </remarks>
187+
/// </para>
188+
/// </summary>
189+
[AddedVersion("3.0.0")]
190+
[DefaultValue(Unit.Percentage)]
191+
[Description("Gets or sets the units for the <b>Width</b>.")]
143192
[Parameter]
144193
public Unit WidthUnit { get; set; } = Unit.Percentage;
145194

146195
/// <summary>
147196
/// Gets or sets the zoom level of the <see cref="GoogleMap" />.
148-
/// </summary>
149-
/// <remarks>
197+
/// <para>
150198
/// Default value is 14.
151-
/// </remarks>
199+
/// </para>
200+
/// </summary>
201+
[AddedVersion("3.0.0")]
202+
[DefaultValue(14)]
203+
[Description("Gets or sets the zoom level of the <b>GoogleMap</b>.")]
152204
[Parameter]
153205
public int Zoom { get; set; } = 14;
154206

blazorbootstrap/Components/Markdown/Markdown.razor.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -678,24 +678,40 @@ private static void RemoveLastLineBreak(List<string> htmlLines)
678678

679679
/// <summary>
680680
/// Gets or sets the CSS class for blockquotes.
681+
/// <para>
682+
/// Default value is "blockquote".
683+
/// </para>
681684
/// </summary>
685+
[AddedVersion("3.1.0")]
686+
[DefaultValue("blockquote")]
687+
[Description("Gets or sets the CSS class for blockquotes.")]
682688
[Parameter]
683-
public string? BlockquotesCssClass { get; set; } = "blockquote";
689+
public string BlockquotesCssClass { get; set; } = "blockquote";
684690

685691
/// <summary>
686692
/// Gets or sets the content to be rendered within the component.
687-
/// </summary>
688-
/// <remarks>
693+
/// <para>
689694
/// Default value is <see langword="null" />.
690-
/// </remarks>
695+
/// </para>
696+
/// </summary>
697+
[AddedVersion("3.1.0")]
698+
[DefaultValue(null)]
699+
[Description("Gets or sets the content to be rendered within the component.")]
700+
[ParameterTypeName("RenderFragment?")]
691701
[Parameter]
692702
public RenderFragment? ChildContent { get; set; }
693703

694704
/// <summary>
695705
/// Gets or sets the CSS class for table.
706+
/// <para>
707+
/// Default value is "table".
708+
/// </para>
696709
/// </summary>
710+
[AddedVersion("3.1.0")]
711+
[DefaultValue("table")]
712+
[Description("Gets or sets the CSS class for table.")]
697713
[Parameter]
698-
public string? TableCssClass { get; set; } = "table";
714+
public string TableCssClass { get; set; } = "table";
699715

700716
#endregion
701717
}

0 commit comments

Comments
 (0)