修复了ConventValue中Parse的错误

This commit is contained in:
2025-10-08 21:43:14 +08:00
parent 3c962267ab
commit 9b9264a6cc

View File

@@ -438,7 +438,7 @@ namespace Convention
public static _T convert_xvalue<_T>([In] string str)
{
Type type = typeof(_T);
var parse_method = type.GetMethod("Parse");
var parse_method = type.GetMethod(nameof(int.Parse), BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string) }, null);
if (parse_method != null &&
(parse_method.ReturnType.IsSubclassOf(type) || parse_method.ReturnType == type) &&
parse_method.GetParameters().Length == 1 &&