|
34 | 34 | namespace GameFrameX.Foundation.Extensions; |
35 | 35 |
|
36 | 36 | /// <summary> |
37 | | -/// 已经存在参数重复异常 |
38 | | -/// 用于表示当参数值已经存在或重复时抛出的异常 |
| 37 | +/// 已经存在参数重复异常。 |
| 38 | +/// 用于表示当参数值已经存在或重复时抛出的异常。 |
39 | 39 | /// </summary> |
| 40 | +/// <remarks> |
| 41 | +/// Exception thrown when an argument value already exists or is duplicated. |
| 42 | +/// </remarks> |
40 | 43 | public sealed class ArgumentAlreadyException : Exception |
41 | 44 | { |
42 | 45 | /// <summary> |
43 | | - /// 已经存在参数重复异常构造函数 |
| 46 | + /// 已经存在参数重复异常构造函数。 |
44 | 47 | /// </summary> |
45 | | - /// <param name="message">异常消息,描述具体的参数重复问题,不能为 null、空字符串或仅包含空白字符</param> |
46 | | - /// <exception cref="ArgumentNullException">当 <paramref name="message"/> 为 null 时抛出</exception> |
47 | | - /// <exception cref="ArgumentException">当 <paramref name="message"/> 为空字符串或仅包含空白字符时抛出</exception> |
| 48 | + /// <remarks> |
| 49 | + /// Initializes a new instance of the <see cref="ArgumentAlreadyException"/> class with a specified error message. |
| 50 | + /// </remarks> |
| 51 | + /// <param name="message">异常消息,描述具体的参数重复问题,不能为 null、空字符串或仅包含空白字符 / The message that describes the error, cannot be null, empty, or whitespace.</param> |
| 52 | + /// <exception cref="ArgumentNullException">当 <paramref name="message"/> 为 null 时抛出 / Thrown when <paramref name="message"/> is null.</exception> |
| 53 | + /// <exception cref="ArgumentException">当 <paramref name="message"/> 为空字符串或仅包含空白字符时抛出 / Thrown when <paramref name="message"/> is empty or whitespace.</exception> |
48 | 54 | public ArgumentAlreadyException(string message) : base(message) |
49 | 55 | { |
50 | 56 | ArgumentException.ThrowIfNullOrWhiteSpace(message, nameof(message)); |
51 | 57 | } |
52 | 58 |
|
53 | 59 | /// <summary> |
54 | | - /// 抛出参数重复异常的静态辅助方法 |
| 60 | + /// 抛出参数重复异常的静态辅助方法。 |
55 | 61 | /// </summary> |
56 | | - /// <param name="message">异常消息,描述具体的参数重复问题,不能为 null、空字符串或仅包含空白字符</param> |
57 | | - /// <exception cref="ArgumentNullException">当 <paramref name="message"/> 为 null 时抛出</exception> |
58 | | - /// <exception cref="ArgumentException">当 <paramref name="message"/> 为空字符串或仅包含空白字符时抛出</exception> |
59 | | - /// <exception cref="ArgumentAlreadyException">当调用此方法时总是抛出此异常</exception> |
| 62 | + /// <remarks> |
| 63 | + /// Throws an <see cref="ArgumentAlreadyException"/> with the specified message. |
| 64 | + /// </remarks> |
| 65 | + /// <param name="message">异常消息,描述具体的参数重复问题,不能为 null、空字符串或仅包含空白字符 / The message that describes the error, cannot be null, empty, or whitespace.</param> |
| 66 | + /// <exception cref="ArgumentNullException">当 <paramref name="message"/> 为 null 时抛出 / Thrown when <paramref name="message"/> is null.</exception> |
| 67 | + /// <exception cref="ArgumentException">当 <paramref name="message"/> 为空字符串或仅包含空白字符时抛出 / Thrown when <paramref name="message"/> is empty or whitespace.</exception> |
| 68 | + /// <exception cref="ArgumentAlreadyException">当调用此方法时总是抛出此异常 / Always thrown when this method is called.</exception> |
60 | 69 | public static void Throw(string message) |
61 | 70 | { |
62 | 71 | ArgumentException.ThrowIfNullOrWhiteSpace(message, nameof(message)); |
|
0 commit comments