fork download
  1. using System;
  2. using System.Reflection;
  3.  
  4.  
  5. namespace SharpTest
  6. {
  7. class Base
  8. {
  9. public static void Test() { }
  10. }
  11.  
  12. class Derived : Base
  13. {
  14. }
  15.  
  16. public class Program
  17. {
  18. public static void Main(string[] args)
  19. {
  20. Console.WriteLine("== Derived");
  21. var methods = typeof(Derived).GetMethods(BindingFlags.Public | BindingFlags.Static);
  22.  
  23. foreach(var methodInfo in methods)
  24. {
  25. Console.WriteLine(methodInfo.Name);
  26. }
  27.  
  28. Console.WriteLine();
  29. Console.WriteLine("== Base");
  30.  
  31. methods = typeof(Base).GetMethods(BindingFlags.Public | BindingFlags.Static);
  32.  
  33. foreach(var methodInfo in methods)
  34. {
  35. Console.WriteLine(methodInfo.Name);
  36. }
  37. }
  38. }
  39. }
  40.  
Success #stdin #stdout 0.02s 34720KB
stdin
Standard input is empty
stdout
== Derived

== Base
Test