Skip to content

Commit 0e7947f

Browse files
committed
doc: 文档注释更改为英文
1 parent 4c74a36 commit 0e7947f

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/BootstrapBlazor/Converter/JsonDescriptionEnumConverter.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
namespace BootstrapBlazor.Components;
1010

1111
/// <summary>
12-
/// 枚举类型转换器 序列化时把枚举类型的 [Description] 标签内容序列化成字符串 推荐使用 <see cref="JsonEnumConverter"/> 转换器
12+
/// Enum type converter that serializes the [Description] attribute of enum values to strings.
13+
/// It is recommended to use <see cref="JsonEnumConverter"/> instead.
1314
/// </summary>
1415
public class JsonDescriptionEnumConverter<T> : JsonConverter<T> where T : struct, Enum
1516
{
1617
/// <summary>
17-
/// <inheritdoc/>
18+
/// Reads and converts the JSON to the specified enum type.
1819
/// </summary>
19-
/// <param name="reader"></param>
20-
/// <param name="typeToConvert"></param>
21-
/// <param name="options"></param>
22-
/// <returns></returns>
20+
/// <param name="reader">The reader.</param>
21+
/// <param name="typeToConvert">The type to convert.</param>
22+
/// <param name="options">The serializer options.</param>
23+
/// <returns>The converted enum value.</returns>
2324
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2425
{
2526
T ret = default;
@@ -36,11 +37,11 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial
3637
}
3738

3839
/// <summary>
39-
/// <inheritdoc/>
40+
/// Writes the specified enum value as a string using its [Description] attribute.
4041
/// </summary>
41-
/// <param name="writer"></param>
42-
/// <param name="value"></param>
43-
/// <param name="options"></param>
42+
/// <param name="writer">The writer.</param>
43+
/// <param name="value">The value to write.</param>
44+
/// <param name="options">The serializer options.</param>
4445
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
4546
{
4647
writer.WriteStringValue(value.ToDescriptionString());

src/BootstrapBlazor/Converter/JsonEnumConverter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
namespace BootstrapBlazor.Components;
1010

1111
/// <summary>
12-
/// JsonEnumConverter 枚举转换器
12+
/// JsonEnumConverter is an enum converter that allows customization of enum serialization.
1313
/// </summary>
1414
/// <param name="camelCase">Optional naming policy for writing enum values.</param>
1515
/// <param name="allowIntegerValues">True to allow undefined enum values. When true, if an enum value isn't defined it will output as a number rather than a string.</param>
1616
public class JsonEnumConverter(bool camelCase = false, bool allowIntegerValues = true) : JsonConverterAttribute
1717
{
1818
/// <summary>
19-
/// <inheritdoc/>
19+
/// Creates a JsonConverter for the specified type.
2020
/// </summary>
21-
/// <param name="typeToConvert"></param>
22-
/// <returns></returns>
21+
/// <param name="typeToConvert">The type to convert.</param>
22+
/// <returns>A JsonConverter for the specified type.</returns>
2323
public override JsonConverter? CreateConverter(Type typeToConvert)
2424
{
2525
var converter = camelCase

0 commit comments

Comments
 (0)