如何从应用到它的属性中获取数据成员(MethodInfo、PropertyInfo 等)的信息。
[Custom]
public void MethodA()
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
sealed class PluginInitAttribute : Attribute
{
public CustomAttribute()
{
//Get MethodA's MethodInfo here
}
}
}
前进!