-
-
Notifications
You must be signed in to change notification settings - Fork 382
doc(Components): update xml comments #7560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,31 +7,29 @@ namespace BootstrapBlazor.Components; | |
|
|
||
| /// <summary> | ||
| /// <para lang="zh">ToastService 扩展方法</para> | ||
| /// <para lang="en">ToastService 扩展方法</para> | ||
| /// <para lang="en">ToastService extension methods</para> | ||
| /// </summary> | ||
| public static class ToastServiceExtensions | ||
| { | ||
| // 特别备注:此处方法使用三个参数被 UniLite 插件系统使用,请勿删除 | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用成功快捷方法</para> | ||
| /// <para lang="en">Toast 调用成功快捷方法</para> | ||
| /// <para lang="en">Toast success shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
|
Comment on lines
18
to
+21
|
||
| public static Task Success(this ToastService service, string? title = null, string? content = null, bool autoHide = true) => Success(service, title, content, autoHide, true); | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用成功快捷方法</para> | ||
| /// <para lang="en">Toast 调用成功快捷方法</para> | ||
| /// <para lang="en">Toast success shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
| /// <param name="showClose"></param> | ||
|
Comment on lines
28
to
+32
|
||
| public static Task Success(this ToastService service, string? title, string? content, bool autoHide, bool showClose) => service.Show(new ToastOption() | ||
| { | ||
| Category = ToastCategory.Success, | ||
|
|
@@ -43,23 +41,23 @@ public static Task Success(this ToastService service, string? title, string? con | |
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用错误快捷方法</para> | ||
| /// <para lang="en">Toast 调用错误快捷方法</para> | ||
| /// <para lang="en">Toast error shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
|
Comment on lines
46
to
+49
|
||
| public static Task Error(this ToastService service, string? title = null, string? content = null, bool autoHide = true) => Error(service, title, content, autoHide, true); | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用错误快捷方法</para> | ||
| /// <para lang="en">Toast 调用错误快捷方法</para> | ||
| /// <para lang="en">Toast error shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
| /// <param name="showClose"></param> | ||
|
Comment on lines
56
to
+60
|
||
| public static Task Error(this ToastService service, string? title, string? content, bool autoHide, bool showClose) => service.Show(new ToastOption() | ||
| { | ||
| Category = ToastCategory.Error, | ||
|
|
@@ -71,23 +69,23 @@ public static Task Error(this ToastService service, string? title, string? conte | |
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用提示信息快捷方法</para> | ||
| /// <para lang="en">Toast 调用提示信息快捷方法</para> | ||
| /// <para lang="en">Toast information shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
|
Comment on lines
74
to
+77
|
||
| public static Task Information(this ToastService service, string? title = null, string? content = null, bool autoHide = true) => Information(service, title, content, autoHide, true); | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用提示信息快捷方法</para> | ||
| /// <para lang="en">Toast 调用提示信息快捷方法</para> | ||
| /// <para lang="en">Toast information shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
| /// <param name="showClose"></param> | ||
|
Comment on lines
84
to
+88
|
||
| public static Task Information(this ToastService service, string? title, string? content, bool autoHide, bool showClose) => service.Show(new ToastOption() | ||
| { | ||
| Category = ToastCategory.Information, | ||
|
|
@@ -99,23 +97,23 @@ public static Task Information(this ToastService service, string? title, string? | |
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用警告信息快捷方法</para> | ||
| /// <para lang="en">Toast 调用警告信息快捷方法</para> | ||
| /// <para lang="en">Toast warning shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
|
Comment on lines
102
to
+105
|
||
| public static Task Warning(this ToastService service, string? title = null, string? content = null, bool autoHide = true) => Warning(service, title, content, autoHide, true); | ||
|
|
||
| /// <summary> | ||
| /// <para lang="zh">Toast 调用警告信息快捷方法</para> | ||
| /// <para lang="en">Toast 调用警告信息快捷方法</para> | ||
| /// <para lang="en">Toast warning shortcut method</para> | ||
| /// </summary> | ||
| /// <param name="service"></param> | ||
| /// <param name="title"><para lang="zh">Title 属性</para><para lang="en">Title property</para></param> | ||
| /// <param name="content"><para lang="zh">Content 属性</para><para lang="en">Content property</para></param> | ||
| /// <param name="autoHide"><para lang="zh">自动隐藏属性默认为 true</para><para lang="en">自动隐藏propertydefault is为 true</para></param> | ||
| /// <param name="showClose"><para lang="zh">是否显示关闭按钮 默认 true</para><para lang="en">whetherdisplay关闭button default is true</para></param> | ||
| /// <param name="title"></param> | ||
| /// <param name="content"></param> | ||
| /// <param name="autoHide"></param> | ||
| /// <param name="showClose"></param> | ||
|
Comment on lines
112
to
+116
|
||
| public static Task Warning(this ToastService service, string? title, string? content, bool autoHide, bool showClose) => service.Show(new ToastOption() | ||
| { | ||
| Category = ToastCategory.Warning, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Consider protecting stream disposal with a try/finally (or using) to avoid leaks if
builder.Build()throws.If
builder.Build()throws, theforeachthat disposesstreamsis never reached and the manifest resource streams are leaked. Ensure stream creation,Build(), and disposal are wrapped so the streams are always disposed even when configuration building fails.Suggested implementation:
To fully satisfy the review comment about protecting against leaks when
builder.Build()throws, you should ensure that the call tobuilder.Build()(wherever it occurs in this method) executes inside the sametryblock that ownsstreams, so that thefinallyabove still runs and disposes the streams ifBuild()fails. For example:builder.Build()into thetryblock that currently wrapsAddJsonStream.builder.Build()is outside thisif (assembly != entryAssembly)block, lift thetry/finallyto a scope that encloses both the JSON stream registration and theBuild()call, and keep thestreamsdisposal in the correspondingfinally.