主页面相关内容和快捷键修改
This commit is contained in:
@@ -36,5 +36,35 @@ namespace NBF
|
||||
|
||||
return derivedTypes;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有标记指定特性的方法
|
||||
/// </summary>
|
||||
/// <param name="classType">查找类</param>
|
||||
/// <param name="attributeType">特性类</param>
|
||||
/// <returns></returns>
|
||||
public static List<MethodInfo> GetMethodsWithUIInputAttribute(Type classType, Type attributeType)
|
||||
{
|
||||
List<MethodInfo> methodsWithAttribute = new List<MethodInfo>();
|
||||
|
||||
if (classType == null)
|
||||
{
|
||||
return methodsWithAttribute;
|
||||
}
|
||||
|
||||
// 获取所有方法,包括公共、非公共、实例和静态方法
|
||||
MethodInfo[] allMethods = classType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic);
|
||||
|
||||
foreach (MethodInfo method in allMethods)
|
||||
{
|
||||
if (method.GetCustomAttributes(attributeType, false).Length > 0)
|
||||
{
|
||||
methodsWithAttribute.Add(method);
|
||||
}
|
||||
}
|
||||
|
||||
return methodsWithAttribute;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user