How can I enumerate methods 开发者_StackOverflow中文版that have MethodAttributes.PrivateScope using Reflection?
Have you tried:
Type t = typeof(MyClass);
var Methods = t.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance);
foreach (MethodInfo mInfo in Methods)
{
if (mInfo.Attributes == MethodAttributes.PrivateScope))
{
// Do what needs to be done.
}
}
精彩评论