Type.GetMethods() : Type « System « C# / C Sharp by API






Type.GetMethods()

    
using System;
using System.Reflection;

class MyClass
{
   public int Field1;
   public int Field2;
   public void Method1() { }
   public int  Method2() { return 1; }
}

class MainClass
{
   static void Main()
   {
      Type t = typeof(MyClass);
      MethodInfo[] mi = t.GetMethods();

      foreach (MethodInfo m in mi)
         Console.WriteLine("Method: {0}", m.Name);

   }
} 

   
    
    
    
  








Related examples in the same category

1.Type.BaseType
2.Type.ContainsGenericParameters
3.Type.FullName
4.Type.GetConstructor
5.Type.GetCustomAttributes
6.Type.GetEvents()
7.Type.GetFields()
8.Type.GetGenericArguments()
9.Type.GetGenericTypeDefinition()
10.Type.GetInterfaces()
11.Type.GetMethod(String methodName);
12.Type.GetProperties()
13.Type.GetType(String typeName)
14.Type.GetType(String typeName, true)
15.Type.GetType(String typeName, true, true);
16.Type.IsAbstract
17.Type.IsClass
18.Type.IsCOMObject
19.Type.IsEnum
20.Type.IsGenericTypeDefinition
21.Type.IsSealed
22.Type.MakeGenericType
23.Type.Name
24.Type.ReflectionOnlyGetType
25.Type.UnderlyingSystemType