Example #1
0
        static void ShowAllMethods(Type t, ShowMethodType showMethodType)
        {
            MemberInfo[] infos = null;
            switch (showMethodType)
            {
            case ShowMethodType.OnlyPublic:
                infos = t.GetMethods(BindingFlags.Public);
                break;

            case ShowMethodType.NoPublic:
                infos = t.GetMethods(BindingFlags.NonPublic);
                break;

            case ShowMethodType.PublicStatic:
                infos = t.GetMethods(BindingFlags.Public & BindingFlags.Static);
                break;

            case ShowMethodType.PublicNoStatic:
                infos = t.GetMethods(BindingFlags.Public & BindingFlags.Instance);
                break;

            default:
                infos = t.GetMethods();
                break;
            }
            foreach (MemberInfo info in infos)
            {
                MyLog.Blue(info.Name);
            }
        }
Example #2
0
 public static void ShowAllMethods(string typeString, ShowMethodType showMethodType)
 {
     ShowAllMethods(GetType(typeString), showMethodType);
 }
Example #3
0
 public static void ShowAllMethods(object obj, ShowMethodType showMethodType)
 {
     ShowAllMethods(obj.GetType(), showMethodType);
 }
Example #4
0
 public static void ShowAllMethods <T>(                    //Log出这个Class的所有方法
     ShowMethodType showMethodType)
 {
     ShowAllMethods(typeof(T), showMethodType);
 }