Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public Dictionary<String, Macro> listMacros()
  2. {
  3. Dictionary<String, Macro> returned = new Dictionary<string,Macro>();
  4. Type instance = this.GetType();
  5. MethodInfo[] methods = instance.GetMethods();
  6.  
  7. foreach (MethodInfo methodInfo in methods)
  8. {
  9. if (!methodInfo.IsPublic || methodInfo.IsAbstract || !methodInfo.IsStatic) { continue; }
  10.  
  11. Macro newMacro = new Macro();
  12. newMacro.name = methodInfo.Name.ToLower();
  13. newMacro.funcType = '$';
  14. newMacro.ClassType = this.GetType();
  15. newMacro.function = methodInfo.Name;
  16. newMacro.method = methodInfo;
  17. returned.Add("$" + methodInfo.Name, newMacro);
  18. }
  19.  
  20. return returned;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement