From 24b48e58e78eb57c8a212d774e917aa65c32e99a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 21 Mar 2026 09:32:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20JSModuleAutoLoa?= =?UTF-8?q?derAttribute=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Attributes/JSModuleAutoLoaderAttribute.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Attributes/JSModuleAutoLoaderAttribute.cs b/src/BootstrapBlazor/Attributes/JSModuleAutoLoaderAttribute.cs index 419d2b734e7..715b71a050a 100644 --- a/src/BootstrapBlazor/Attributes/JSModuleAutoLoaderAttribute.cs +++ b/src/BootstrapBlazor/Attributes/JSModuleAutoLoaderAttribute.cs @@ -9,7 +9,10 @@ namespace BootstrapBlazor.Components; /// JSModuleAutoLoaderAttribute 类 /// JSModuleAutoLoaderAttribute class /// -/// JavaScript 模块的路径The path to the JavaScript module +/// +/// JavaScript 模块的路径 +/// The path to the JavaScript module +/// [AttributeUsage(AttributeTargets.Class)] public class JSModuleAutoLoaderAttribute(string? path = null) : Attribute { From f2e34dc365aad69f00f8394877438674b8852b7f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 21 Mar 2026 09:32:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20JSModuleNotInhe?= =?UTF-8?q?ritedAttribute=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Attributes/JSModuleNotInheritedAttribute.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Attributes/JSModuleNotInheritedAttribute.cs b/src/BootstrapBlazor/Attributes/JSModuleNotInheritedAttribute.cs index 68c91bfb5e6..e891dcb7406 100644 --- a/src/BootstrapBlazor/Attributes/JSModuleNotInheritedAttribute.cs +++ b/src/BootstrapBlazor/Attributes/JSModuleNotInheritedAttribute.cs @@ -6,8 +6,8 @@ namespace BootstrapBlazor.Components; /// -/// JSModuleNotInheritedAttribute -/// JSModuleNotInheritedAttribute +/// 表示该类不继承 JSModuleAutoLoaderAttribute 的特性 +/// Indicates that this class does not inherit the JSModuleAutoLoaderAttribute /// [AttributeUsage(AttributeTargets.Class)] public sealed class JSModuleNotInheritedAttribute : Attribute From 7d607becfcb9b37d9a47e6ebbddfab3ec78961c7 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 21 Mar 2026 09:32:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20TableMetadataFo?= =?UTF-8?q?rAttribute=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Attributes/TableMetadataForAttribute.cs | 50 ++++++------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs b/src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs index f48595cb2f2..7fe8c10cf21 100644 --- a/src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs +++ b/src/BootstrapBlazor/Attributes/TableMetadataForAttribute.cs @@ -6,31 +6,18 @@ namespace BootstrapBlazor.Components; /// -/// 定义目标数据类型的 UI 生成元数据组 -/// 通常模型类型位于与 Blazor 组件 UI 层不同的层 -/// 在这种情况下,使用 为 Table 组件定义元数据类型 -/// 然后使用 注册元数据类型 -/// Define a group of UI generation metadata for target data type -/// Usually model types are at different layer to the blazor component UI layer -/// In this case, use to define a metadata type for Table component -/// Then register metadata type with -/// +/// 定义目标数据类型的 UI 生成元数据组,通常模型类型位于与 Blazor 组件 UI 层不同的层,在这种情况下,使用 为 Table 组件定义元数据类型,然后使用 注册元数据类型 +/// 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 to define a metadata type for the Table component, and then use to register the metadata type. /// -/// 示例: -/// Pig 数据类型通常位于业务层或数据层 -/// Example: -/// the Pig data type is usually at biz or data layer -/// +/// 示例:Pig 数据类型通常位于业务层或数据层; Example: the Pig data type is usually at biz or data layer +/// /// public class Pig /// { /// public string? Name1 { get; set; } /// /// public string? Name2 { get; set; } /// } -/// -/// PigMetadata 可以定义在 UI/组件层 -/// the PigMetadata can be defined at UI/component layer -/// +/// /// [TableMetadataFor(typeof(Pig))] /// [AutoGenerateClass(Align = Alignment.Center)] /// public class PigMetadata @@ -41,28 +28,19 @@ namespace BootstrapBlazor.Components; /// [AutoGenerateColumn(Align = Alignment.Center, Order = -2)] /// public string? Name2 { get; set; } /// } -/// -/// 在使用元数据之前,需要注册元数据类型 -/// 在程序集中注册元数据类型 -/// before using the metadata, it needs to register the metadata types -/// register metadata types in assembly -/// +/// +/// register metadata types in assembly +/// /// TableMetadataTypeService.RegisterMetadataTypes(typeof(Pig).Assembly); -/// var cols = Utility.GetTableColumns<Pig>().ToList(); -/// Assert.Single(cols); -/// -/// 或者您可以单独注册类型 -/// or you can register types individually -/// +/// // or /// TableMetadataTypeService.RegisterMetadataType(metadataType, dataType); -/// +/// /// /// -/// -/// TableMetadataForAttribute 构造函数 -/// Constructor TableMetadataForAttribute for target data type -/// -/// 目标模型/数据类型The target model/data type +/// +/// 目标模型/数据类型 +/// The target model/data type +/// [AttributeUsage(AttributeTargets.Class)] public class TableMetadataForAttribute(Type dataType) : Attribute {