title: Call static method with reflection
body: <p>I have several static classes in the namespace <code>mySolution.Macros</code> such as </p>
  
  <pre><code>static class Indent{    
       public static void Run(){
           // implementation
       }
       // other helper methods
  }
  </code></pre>
  
  <p><strong>So my question is how it will be possible to call those methods with the help of reflection?</strong></p>
  
  <p>If the methods where NOT to be static then I could do something like:</p>
  
  <pre><code>var macroClasses = Assembly.GetExecutingAssembly().GetTypes().Where( x =&gt; x.Namespace.ToUpper().Contains("MACRO") );
  
  foreach (var tempClass in macroClasses)
  {
     var curInsance = Activator.CreateInstance(tempClass);
     // I know have an instance of a macro and will be able to run it
  
     // using reflection I will be able to run the method as:
     curInsance.GetType().GetMethod("Run").Invoke(curInsance, null);
  }
  </code></pre>
  
  <p>I will like to keep my classes static. How will I be able to do something similar with static methods?</p>
  
  <p><strong>In short</strong> I will like to call all the Run methods from all the static classes that are in the namespace mySolution.Macros.</p>