title: Reflection, MethodInfo, GetMethods, include only methods only added by me
body: <p>I am new to C#.</p>
  
  <p>I wrote an application which uses reflection to iterate through all methods of selected object and runs it.</p>
  
  <p>The problem is that <code>MethodInfo[] methodInfos = typeof(ClassWithManyMethods).GetMethods();</code> returns also methods like <code>ToString</code>, <code>GetType</code> and I would like to include only methods declared specifically for my class.</p>
  
  <p>Please have a look at my code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Reflection;
  
  
  namespace Reflection4
  {
      class ClassWithManyMethods
      {
      public void a()
      {
          Console.Write('a');
      }
  
      public void b()
      {
          Console.Write('b');
      }
  
      public void c()
      {
          Console.Write('c');
      }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          // get all public static methods of MyClass type
          MethodInfo[] methodInfos = typeof(ClassWithManyMethods).GetMethods();
          ClassWithManyMethods myObject = new ClassWithManyMethods();
  
          foreach (MethodInfo methodInfo in methodInfos)
          {
              Console.WriteLine(methodInfo.Name);
              methodInfo.Invoke(myObject, null); //problem here!
          }
      }
  }
  </code></pre>