Get methods from Object - CSharp System

CSharp examples for System:Object

Description

Get methods from Object

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System;/*  ww w .  ja  v  a  2s  .  c  om*/

public class Main{
        public static void methods(this Object obj)
        {
            if (obj == null) return;

            methods(obj.GetType());
        }
        public static void methods(this Type t)
        {
            foreach (MethodInfo mi in t.GetMethods())
            {
                Console.WriteLine("  " + mi);
            }
        }
}

Related Tutorials