Skip to content

Commit 9566498

Browse files
committed
docs(ReflectionExtensions): 修复XML文档注释中的cref格式问题
统一将XML文档注释中的<see cref="..."/>格式修改为<see><cref>...</cref></see>格式,提高文档一致性
1 parent f40753c commit 9566498

1 file changed

Lines changed: 39 additions & 16 deletions

File tree

GameFrameX.Foundation.Extensions/ReflectionExtensions.cs

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ public static Type GetTypeInfo(this Type typeInfo)
6666
/// 获取类型的泛型参数集合。
6767
/// </summary>
6868
/// <param name="type">要检查的类型。</param>
69-
/// <returns>包含泛型参数的 <see cref="System.Type[]"/>;非泛型类型返回空数组。</returns>
69+
/// <returns>包含泛型参数的 <see>
70+
/// <cref>System.Type[]</cref>
71+
/// </see>
72+
/// ;非泛型类型返回空数组。</returns>
7073
/// <remarks>
7174
/// 示例:
7275
/// - 对 <see cref="System.Collections.Generic.List{T}"/>,其 {T} 将作为一个元素返回;
@@ -89,7 +92,10 @@ public static Type[] GetGenericArguments(this Type type)
8992
/// <param name="type">要检查的类型。</param>
9093
/// <returns>若为泛型类型返回 <see langword="true"/>,否则返回 <see langword="false"/>。</returns>
9194
/// <remarks>
92-
/// 开放泛型与封闭泛型均视为泛型类型,例如 <see cref="System.Collections.Generic.List{T}"/> 与 <see cref="System.Collections.Generic.List{System.String}"/>。
95+
/// 开放泛型与封闭泛型均视为泛型类型,例如 <see cref="System.Collections.Generic.List{T}"/> 与 <see>
96+
/// <cref>System.Collections.Generic.List{System.String}</cref>
97+
/// </see>
98+
/// 。
9399
/// </remarks>
94100
/// <exception cref="System.NullReferenceException">当 <paramref name="type"/> 为 <see langword="null"/> 时。</exception>
95101
/// <seealso cref="System.Type.IsGenericType"/>
@@ -103,9 +109,15 @@ public static bool IsGenericType(this Type type)
103109
/// 获取类型的公共实例属性集合。
104110
/// </summary>
105111
/// <param name="type">要检查的类型。</param>
106-
/// <returns>属性数组 <see cref="System.Reflection.PropertyInfo[]"/>。</returns>
112+
/// <returns>属性数组 <see>
113+
/// <cref>System.Reflection.PropertyInfo[]</cref>
114+
/// </see>
115+
/// 。</returns>
107116
/// <remarks>
108-
/// 等价于 <see cref="System.Reflection.TypeInfo.GetProperties"/> 的行为。
117+
/// 等价于 <see>
118+
/// <cref>System.Reflection.TypeInfo.GetProperties</cref>
119+
/// </see>
120+
/// 的行为。
109121
/// </remarks>
110122
/// <exception cref="System.NullReferenceException">当 <paramref name="type"/> 为 <see langword="null"/> 时。</exception>
111123
/// <seealso cref="System.Reflection.PropertyInfo"/>
@@ -123,10 +135,10 @@ public static PropertyInfo[] GetProperties(this Type type)
123135
/// <param name="name">属性名称,区分大小写。</param>
124136
/// <returns>匹配的 <see cref="System.Reflection.PropertyInfo"/>;未找到时返回 <see langword="null"/>。</returns>
125137
/// <remarks>
126-
/// 当存在多个重名属性(极少见)时,可能产生 <see cref="System.AmbiguousMatchException"/>。
138+
/// 当存在多个重名属性(极少见)时,可能产生 <see cref="AmbiguousMatchException"/>。
127139
/// </remarks>
128140
/// <exception cref="System.ArgumentNullException">当 <paramref name="name"/> 为 <see langword="null"/> 时。</exception>
129-
/// <exception cref="System.AmbiguousMatchException">当找到多个具有相同名称的属性时。</exception>
141+
/// <exception cref="AmbiguousMatchException">当找到多个具有相同名称的属性时。</exception>
130142
/// <seealso cref="System.Reflection.PropertyInfo"/>
131143
/// <seealso cref="System.Type.GetProperty(System.String)"/>
132144
public static PropertyInfo GetProperty(this Type type, string name)
@@ -142,10 +154,10 @@ public static PropertyInfo GetProperty(this Type type, string name)
142154
/// <param name="name">字段名称,区分大小写。</param>
143155
/// <returns>匹配的 <see cref="System.Reflection.FieldInfo"/>;未找到时返回 <see langword="null"/>。</returns>
144156
/// <remarks>
145-
/// 当存在多个重名字段时,可能产生 <see cref="System.AmbiguousMatchException"/>。
157+
/// 当存在多个重名字段时,可能产生 <see cref="AmbiguousMatchException"/>。
146158
/// </remarks>
147159
/// <exception cref="System.ArgumentNullException">当 <paramref name="name"/> 为 <see langword="null"/> 时。</exception>
148-
/// <exception cref="System.AmbiguousMatchException">当找到多个具有相同名称的字段时。</exception>
160+
/// <exception cref="AmbiguousMatchException">当找到多个具有相同名称的字段时。</exception>
149161
/// <seealso cref="System.Reflection.FieldInfo"/>
150162
/// <seealso cref="System.Type.GetField(System.String)"/>
151163
public static FieldInfo GetField(this Type type, string name)
@@ -174,10 +186,10 @@ public static bool IsEnum(this Type type)
174186
/// <param name="name">方法名称,区分大小写。</param>
175187
/// <returns>匹配的 <see cref="System.Reflection.MethodInfo"/>;未找到时返回 <see langword="null"/>。</returns>
176188
/// <remarks>
177-
/// 当存在多个重名方法且无法唯一选择时会抛出 <see cref="System.AmbiguousMatchException"/>。
189+
/// 当存在多个重名方法且无法唯一选择时会抛出 <see cref="AmbiguousMatchException"/>。
178190
/// </remarks>
179191
/// <exception cref="System.ArgumentNullException">当 <paramref name="name"/> 为 <see langword="null"/> 时。</exception>
180-
/// <exception cref="System.AmbiguousMatchException">当找到多个具有相同名称的方法时。</exception>
192+
/// <exception cref="AmbiguousMatchException">当找到多个具有相同名称的方法时。</exception>
181193
/// <seealso cref="System.Reflection.MethodInfo"/>
182194
/// <seealso cref="System.Type.GetMethod(System.String)"/>
183195
public static MethodInfo GetMethod(this Type type, string name)
@@ -191,15 +203,23 @@ public static MethodInfo GetMethod(this Type type, string name)
191203
/// </summary>
192204
/// <param name="type">要检查的类型。</param>
193205
/// <param name="name">方法名称。</param>
194-
/// <param name="types">参数类型数组 <see cref="System.Type[]"/>。</param>
206+
/// <param name="types">参数类型数组 <see>
207+
/// <cref>System.Type[]</cref>
208+
/// </see>
209+
/// 。</param>
195210
/// <returns>匹配的 <see cref="System.Reflection.MethodInfo"/>;未找到时返回 <see langword="null"/>。</returns>
196211
/// <remarks>
197-
/// 传入 <paramref name="types"/> 可用于在重载中进行精确匹配;数组类型请使用 <see cref="System.Type[]"/>;
212+
/// 传入 <paramref name="types"/> 可用于在重载中进行精确匹配;数组类型请使用 <see>
213+
/// <cref>System.Type[]</cref>
214+
/// </see>
215+
/// ;
198216
/// 引用参数类型请使用 <c>System.Type&amp;</c>;指针参数类型请使用 <c>System.Type*</c>。
199217
/// </remarks>
200218
/// <exception cref="System.ArgumentNullException">当 <paramref name="name"/> 或 <paramref name="types"/> 为 <see langword="null"/> 时。</exception>
201-
/// <exception cref="System.AmbiguousMatchException">当找到多个具有相同签名的方法时。</exception>
202-
/// <seealso cref="System.Type[]"/>
219+
/// <exception cref="AmbiguousMatchException">当找到多个具有相同签名的方法时。</exception>
220+
/// <seealso>
221+
/// <cref>System.Type[]</cref>
222+
/// </seealso>
203223
/// <seealso cref="System.Type.GetMethod(System.String,System.Type[])"/>
204224
public static MethodInfo GetMethod(this Type type, string name, Type[] types)
205225
{
@@ -211,13 +231,16 @@ public static MethodInfo GetMethod(this Type type, string name, Type[] types)
211231
/// 使用参数类型签名获取类型的公共构造函数。
212232
/// </summary>
213233
/// <param name="type">要检查的类型。</param>
214-
/// <param name="types">参数类型数组 <see cref="System.Type[]"/>。</param>
234+
/// <param name="types">参数类型数组 <see>
235+
/// <cref>System.Type[]</cref>
236+
/// </see>
237+
/// 。</param>
215238
/// <returns>匹配的 <see cref="System.Reflection.ConstructorInfo"/>;未找到时返回 <see langword="null"/>。</returns>
216239
/// <remarks>
217240
/// 传入 <paramref name="types"/> 可用于在重载中精确选择构造函数;引用参数类型请使用 <c>System.Type&amp;</c>,指针参数类型请使用 <c>System.Type*</c>。
218241
/// </remarks>
219242
/// <exception cref="System.ArgumentNullException">当 <paramref name="types"/> 为 <see langword="null"/> 时。</exception>
220-
/// <exception cref="System.AmbiguousMatchException">当找到多个具有相同签名的构造函数时。</exception>
243+
/// <exception cref="AmbiguousMatchException">当找到多个具有相同签名的构造函数时。</exception>
221244
/// <seealso cref="System.Reflection.ConstructorInfo"/>
222245
/// <seealso cref="System.Type.GetConstructor(System.Type[])"/>
223246
public static ConstructorInfo GetConstructor(this Type type, Type[] types)

0 commit comments

Comments
 (0)