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 { 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 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 {