I have a custom attribute:
public class MenuItemAttribute : Attribute
{
}
and a class with a few methods:
public class HelloWorld
{
    [MenuItemAttribute]
    public void Shout()
    {
    }
    [MenuItemAttribute]
    public void Cry()
    {
    }
    public void RunLikeHell()
    {
    }
}
How can I get only the methods that are decorated with the custom attribute?
So far, I have this:
string assemblyName = fileInfo.FullName;
byte[] assemblyBytes = File.ReadAllBytes(assemblyName);
Assembly assembly = Assembly.Load(assemblyBytes);
foreach (Type type in assembly.GetTypes())
{
     System.Attribute[] attributes = System.Attribute.GetCustomAttributes(type);
     foreach (Attribute attribute in attributes)
     {
         if (attribute is MenuItemAttribute)
         {
             //Get me the method info
             //MethodInfo[] methods = attribute.GetType().GetMethods();
         }
     }
}
What I need now is to get the method name, the return type, as well as the parameters it accepts.
 
     
     
     
     
    