Skip to content

Commit d3661a7

Browse files
authored
doc(Attributes): update components xml comments (#7780)
* doc: 更新 JSModuleAutoLoaderAttribute 文档 * doc: 更新 JSModuleNotInheritedAttribute 注释 * doc: 更新 TableMetadataForAttribute 注释
1 parent 67410a8 commit d3661a7

File tree

3 files changed

+20
-39
lines changed

3 files changed

+20
-39
lines changed

src/BootstrapBlazor/Attributes/JSModuleAutoLoaderAttribute.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ namespace BootstrapBlazor.Components;
99
/// <para lang="zh">JSModuleAutoLoaderAttribute 类</para>
1010
/// <para lang="en">JSModuleAutoLoaderAttribute class</para>
1111
/// </summary>
12-
/// <param name="path"><para lang="zh">JavaScript 模块的路径</para><para lang="en">The path to the JavaScript module</para></param>
12+
/// <param name="path">
13+
/// <para lang="zh">JavaScript 模块的路径</para>
14+
/// <para lang="en">The path to the JavaScript module</para>
15+
/// </param>
1316
[AttributeUsage(AttributeTargets.Class)]
1417
public class JSModuleAutoLoaderAttribute(string? path = null) : Attribute
1518
{

src/BootstrapBlazor/Attributes/JSModuleNotInheritedAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// <para lang="zh">JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/></para>
10-
/// <para lang="en">JSModuleNotInheritedAttribute <see cref="JSModuleAutoLoaderAttribute"/></para>
9+
/// <para lang="zh">表示该类不继承 JSModuleAutoLoaderAttribute 的特性</para>
10+
/// <para lang="en">Indicates that this class does not inherit the JSModuleAutoLoaderAttribute</para>
1111
/// </summary>
1212
[AttributeUsage(AttributeTargets.Class)]
1313
public sealed class JSModuleNotInheritedAttribute : Attribute

src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,18 @@
66
namespace BootstrapBlazor.Components;
77

88
/// <summary>
9-
/// <para lang="zh">定义目标数据类型的 UI 生成元数据组</para>
10-
/// <para lang="zh">通常模型类型位于与 Blazor 组件 UI 层不同的层</para>
11-
/// <para lang="zh">在这种情况下,使用 <see cref="TableMetadataForAttribute"/> 为 Table 组件定义元数据类型</para>
12-
/// <para lang="zh">然后使用 <seealso cref="TableMetadataTypeService"/> 注册元数据类型</para>
13-
/// <para lang="en">Define a group of UI generation metadata for target data type</para>
14-
/// <para lang="en">Usually model types are at different layer to the blazor component UI layer</para>
15-
/// <para lang="en">In this case, use <see cref="TableMetadataForAttribute"/> to define a metadata type for Table component</para>
16-
/// <para lang="en">Then register metadata type with <seealso cref="TableMetadataTypeService"/></para>
17-
///
9+
/// <para lang="zh">定义目标数据类型的 UI 生成元数据组,通常模型类型位于与 Blazor 组件 UI 层不同的层,在这种情况下,使用 <see cref="TableMetadataForAttribute"/> 为 Table 组件定义元数据类型,然后使用 <seealso cref="TableMetadataTypeService"/> 注册元数据类型</para>
10+
/// <para lang="en">Defines a group of UI generation metadata for the target data type. Usually, model types are located in a different layer than the Blazor component UI layer. In this case, use <see cref="TableMetadataForAttribute"/> to define a metadata type for the Table component, and then use <seealso cref="TableMetadataTypeService"/> to register the metadata type.</para>
1811
/// <example>
19-
/// <para lang="zh">示例:</para>
20-
/// <para lang="zh">Pig 数据类型通常位于业务层或数据层</para>
21-
/// <para lang="en">Example:</para>
22-
/// <para lang="en">the Pig data type is usually at biz or data layer</para>
23-
/// <code>
12+
/// <para>示例:Pig 数据类型通常位于业务层或数据层; Example: the Pig data type is usually at biz or data layer</para>
13+
/// <code>
2414
/// public class Pig
2515
/// {
2616
/// public string? Name1 { get; set; }
2717
///
2818
/// public string? Name2 { get; set; }
2919
/// }
30-
/// </code>
31-
/// <para lang="zh">PigMetadata 可以定义在 UI/组件层</para>
32-
/// <para lang="en">the PigMetadata can be defined at UI/component layer</para>
33-
/// <code>
20+
///
3421
/// [TableMetadataFor(typeof(Pig))]
3522
/// [AutoGenerateClass(Align = Alignment.Center)]
3623
/// public class PigMetadata
@@ -41,28 +28,19 @@ namespace BootstrapBlazor.Components;
4128
/// [AutoGenerateColumn(Align = Alignment.Center, Order = -2)]
4229
/// public string? Name2 { get; set; }
4330
/// }
44-
/// </code>
45-
/// <para lang="zh">在使用元数据之前,需要注册元数据类型</para>
46-
/// <para lang="zh">在程序集中注册元数据类型</para>
47-
/// <para lang="en">before using the metadata, it needs to register the metadata types</para>
48-
/// <para lang="en">register metadata types in assembly</para>
49-
/// <code>
31+
/// </code>
32+
/// <para>register metadata types in assembly</para>
33+
/// <code>
5034
/// TableMetadataTypeService.RegisterMetadataTypes(typeof(Pig).Assembly);
51-
/// var cols = Utility.GetTableColumns&lt;Pig&gt;().ToList();
52-
/// Assert.Single(cols);
53-
/// </code>
54-
/// <para lang="zh">或者您可以单独注册类型</para>
55-
/// <para lang="en">or you can register types individually</para>
56-
/// <code>
35+
/// // or
5736
/// TableMetadataTypeService.RegisterMetadataType(metadataType, dataType);
58-
/// </code>
37+
/// </code>
5938
/// </example>
6039
/// </summary>
61-
/// <remarks>
62-
/// <para lang="zh">TableMetadataForAttribute 构造函数</para>
63-
/// <para lang="en">Constructor TableMetadataForAttribute for target data type</para>
64-
/// </remarks>
65-
/// <param name="dataType"><para lang="zh">目标模型/数据类型</para><para lang="en">The target model/data type</para></param>
40+
/// <param name="dataType">
41+
/// <para lang="zh">目标模型/数据类型</para>
42+
/// <para lang="en">The target model/data type</para>
43+
/// </param>
6644
[AttributeUsage(AttributeTargets.Class)]
6745
public class TableMetadataForAttribute(Type dataType) : Attribute
6846
{

0 commit comments

Comments
 (0)